Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Cache recommendation

Started by Muut Archive 11 years ago · 2 replies · 604 views
11 years ago

Hi all,
I've caching enabled at /user/config/system.yaml but when I check my page at Pingdom I only get 5% at 'Leverage browser caching'. It lists most js and css from theme and plugin folder. What should be done to improve this? I've seen 3 cache plugins, or I could modify .htaccess.
What is recommended?

11 years ago

First you have to realize there are many kinds of cache. Application cache, PHP opcode cache, PHP user cache, Browser cache, Twig cache, reverse proxy cache, and more!

The cache option in the system.yaml enables/disables a Grav application cache. This means that things that take the most time in Grav, are cached, so they don't take as much time the next time you need them.

Your Pingdom checkpage is only testing for Browser cache, and that is generally controlled by your webserver that serves the pages. For Apache, this can be done with .htaccess. There are many articles on this as it's not a Grav-specific issue. Here are a couple to help you out:

http://www.feedthebot.com/pagespeed/leverage-browser-caching.html
https://thomasgriffin.io/how-to-leverage-browser-caching-in-wordpress-via-htaccess/

11 years ago

Hi rhukster,
thanks for clarification. I'm aware that there are multiple caching options, I just wanted to avoid that e.g. enabling the cache via htaccess might cause some problems with other caching options already implemented in grav. Thanks!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1321 9 years ago
Archive · by Muut Archive, 9 years ago
2 916 9 years ago
Archive · by Muut Archive, 9 years ago
2 4047 9 years ago
Archive · by Muut Archive, 9 years ago
1 2921 9 years ago
Archive · by Muut Archive, 9 years ago
3 1105 9 years ago