Cacheable Datasource
Cache the XML result of your DS
Browse
Description
Disclaimer
This is relatively untested. Use with caution. If you hit problems, please try and debug and send patches via Github. There are a couple of edge cases that I have yet to diagnose whereby a cache "miss" means no XML is returned for that page load. Only spotted it a few times ever, so certainly an edge case.
Description
Some datasources simply execute a lot of database queries, and if you run a busy website then certain DSs may be a performance hit. Presently you have several options:
- reduce the number of fields and entries your DS is querying
- use the Cachelite extension to cache the entire rendered HTML output of pages (useful to survive the Digg-effect)
However sometimes neither of these are viable. Perhaps you really need all of that data in your XML, or perhaps you have a "Logged in as {user}" notice in the header that means you can't cache the HTML output for all users.
This extension bundles a CacheableDatasource class from which your data sources can extend.