Archived topic
how do i do this with gp elements?
8 replies · Started by sparkle on February 16, 2019
i'm trying to implement this browser cache solution and have tried, with no joy, putting the scripts in my child theme and in the gp elements for the header. where is the best place to implement the non-htaccess part of this?
The first solution is for blogspot.com blogs while the second is for WordPress. If you want a custom code inside the .htacess file, try this one.
<IfModule mod_expires.c>
AddType application/font-woff2 .woff2
ExpiresActive On
ExpiresDefault A0
ExpiresByType video/webm A10368000
ExpiresByType video/ogg A10368000
ExpiresByType video/mp4 A10368000
ExpiresByType image/webp A10368000
ExpiresByType image/gif A10368000
ExpiresByType image/png A10368000
ExpiresByType image/jpg A10368000
ExpiresByType image/jpeg A10368000
ExpiresByType image/ico A10368000
ExpiresByType image/svg+xml A10368000
ExpiresByType text/css A10368000
ExpiresByType text/javascript A10368000
ExpiresByType application/javascript A10368000
ExpiresByType application/x-javascript A10368000
ExpiresByType application/font-woff2 A10368000
</IfModule>
Looks good to me, epic - thanks for sharing! :)
ok. thanks epic!
so with this solution, do i need to add the <include expiration='7d' path='*.css'/> bits to my head? just adding your code to my .htaccess didn't change the marks from gtmetrix or pingdom for browser cacheing.
No, I don't believe so. That looks specific to Blogger (not WordPress).
It's possible that your hosting ignores those variables in your .htaccess, and that you need to get them to add the caching to your server.
maybe. i'll ask. thanks.
No problem.
fyi, they did have a very specific cache header for the htaccess. thanks.
No problem :)