How to cache Joomla site?
Posted: Sat Mar 30, 2024 9:30 pm
It has been discussed probably a thousand times.
What is the best approach for caching a small site like a blog updated weekly?
Presently I have in Global Configuration:
System Cache: ON - Conservative caching
Cache handler: File
Platform-specific caching: No
Cache time: 30 min
Path to cache folder: [BLANK]
Additionally, I have the following code in .htaccess file:
This code is circulating in many sites, and I believe it is correct without errors.
Surprisingly https://pagespeed.web.dev is complaining:
Presently mine:
For me, caching is doubled, but I'm not sure if this is good or bad.
What do you think about all that? Is it OK .htaccess to include ExpiresByType directives when Caching is ON in Global Configuration? Or are they different things?
What is the best approach for caching a small site like a blog updated weekly?
Presently I have in Global Configuration:
System Cache: ON - Conservative caching
Cache handler: File
Platform-specific caching: No
Cache time: 30 min
Path to cache folder: [BLANK]
Additionally, I have the following code in .htaccess file:
Code: Select all
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 week"
# Images
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
...
...
</IfModule>
Surprisingly https://pagespeed.web.dev is complaining:
The problem was mostly in CSS files. PageSpeeds wants CSS to be cached for more than 2 months, though JS could be only month cached. Strange.Serve static assets with an efficient cache policy --- 13 resources found
Presently mine:
Code: Select all
ExpiresByType text/css "access plus 6 month"
What do you think about all that? Is it OK .htaccess to include ExpiresByType directives when Caching is ON in Global Configuration? Or are they different things?