There is a VirtueMart based site where I need some information about the products which are collected from VM's tables and other external tables/files aswell. These are some pieces of related metadata information and not just the products. E.g: date interval of weekly sales, categories/products which are included in the sale, discount percentage, etc etc. Some of them are not directly connected to VM but I need to display it.
I need these information site-wide like in category view, productdetails view, cart, order emails, some modules or vmcustom plugins, etc.
So the question: What is the best way to collect the information once per pageload (or perhaps per session) but use it in several parts of the site? I want to do this mainly for performance reasons and of course for a more clear code.
something like your own plugin with its own table then fetch/call these values and display
You can use Joomla cache as base, you can use it to cache HTML or code(json object, db results for eg.) or use a file cache.
If you need it per pageload, then you can use a static value or array in a class using an instance Id.