Are there any docs about how to setup and use Kirbyās built-in caching in different scenarios?
I have a customer who is working with an SEO specialist, who wants to speed up page loading times, so Iām guessing that turning caching on will helpā¦?
I am, however, concerned about understanding how the whole caching mechanism works - what gets cached, where, and when does it get updated - and whether there are any āgotchasā that we should be aware of.
So, if in my site I have a contact form or newsletter subscription form in the FOOTER - which appears on every page of the site - then there is no point in turning the cache on?..
Excactly, with forms on every page, the native cache doesnāt make sense.
You can, however, use the cache methods to write parts of your page or results of functions to the cache. Some plugins do that, you can check out some examples of how to do that.
Imho itās a lazy excuse to not cache pages because of a form in the footer. Without knowing your entire use case, you could even use the file cache in your setup as follows:
You could post the form to another page (which is excluded from the caching).
If your templates donāt contain any complex logic (like displaying a huge list of pages that are filtered and sorted) and if they donāt depend on data from an external API, the render time of a Kirby page itself is already quite fast.
The āpage load timeā mostly consists of assets like JS files, images and ads. Caching pages in Kirby definitely makes sense, but if you need to jump through a lot of hoops to implement it, I would first look into the other parts of the page where the optimization effect is often larger.
Thank you for the guidance, and the suggestions, guys - truly appreciated.
After some initial page loading time analysis, it seems that about 70% of the initial loading time is due to pre-loading of the many images within the pages. We will now investigate alternative ways of improving that by using ālazy-loadingā JavaScript libraries, and perhaps moving some of these static assets to CDN. This will probably have a bigger impact on loading times than turning on the cache.
Once again, many thanks for your input and guidance.