expire headers code from hummingbird not working – other code ye
-
Hello,
I am using hummingbird Version 3.6.0 and WordPress Version: 6.3.2, other Plugins deactivated.
When I check my site with Chrome Console Cache Control is max age 0.
In the htacess. is this:
-
# BEGIN WP-HUMMINGBIRD-CACHING # Die Anweisungen (Zeilen) zwischen ?BEGIN WP-HUMMINGBIRD-CACHING“ und ?END WP-HUMMINGBIRD-CACHING“ sind # dynamisch generiert und sollten nur über WordPress-Filter ge?ndert werden. # Alle ?nderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben. <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A0 <FilesMatch "\.(txt|xml|js)$"> ExpiresDefault A31536000 </FilesMatch> <FilesMatch "\.(css)$"> ExpiresDefault A31536000 </FilesMatch> <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|woff2|svg)$"> ExpiresDefault A31536000 </FilesMatch> <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$"> ExpiresDefault A31536000 </FilesMatch> </IfModule> <IfModule mod_headers.c> <FilesMatch "\.(txt|xml|js)$"> Header set Cache-Control "max-age=31536000" </FilesMatch> <FilesMatch "\.(css)$"> Header set Cache-Control "max-age=31536000" </FilesMatch> <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|woff2|svg)$"> Header set Cache-Control "max-age=31536000" </FilesMatch> <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$"> Header set Cache-Control "max-age=31536000" </FilesMatch> </IfModule> # END WP-HUMMINGBIRD-CACHING
But when I use other code, Cache Control header max age is shown correct.
Here is the code## EXPIRES HEADER CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType image/svg "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType application/javascript "access 1 month" ExpiresByType application/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 2 days" </IfModule> ## EXPIRES HEADER CACHING ##
What can be the issue? Thanks
Hi @sasasasaaa,
I’m not able to notice such an issue when I test by enabling the Browser cache in Hummingbird.
The mentioned rules are related to Hummingbird browser cache and it should be changing the cache control for images/media and JS/CSS assets.
Is that the files which you are checking or any specific page?
Possible to share the page URL and the assets on that specific page where you notice cache-control not working so that we could have a better idea?
Looking forward to your response.
Kind Regards,
Nithin
Hi, I am checking pages.
How do I share the assets – where do I find them? In the assets settings I haven’t found an export link?
Hi @sasasasaaa
I hope you are doing well.
You can share the link to your site, and then we can check the CSS/JS and expiration time using the browser.
Also note, that the browser cache is a Server side setting, Hummingbird only applies some default rules that are compatible with most of servers, in case the rules are not working but a different one works well this can be related to any server configuration.
We use the “FilesMatch” to validate the file format if for any reason the hosting provider limits the usage of this, or requires a different way such as you shared it is fine and I would suggest using that approach.
As long as it is set to 1y the approach you use wouldn’t matter.
Best Regards
Patrick FreitasHi, I do not wanna share the link in public. How do I sent it to you?
Hi @sasasasaaa
Hi, I do not wanna share the link in public. How do I sent it to you?
Please drop us a line at “[email protected]”.
Note:
– do NOT share any “sensitive” data – no any access credentials etc, only the link to the site
– use this as a subject line:
ATTN: WPMU DEV support - wp.org
– and include link back to this topic in your message (so we could easily identify the case).
Best regards,
AdamHi?@sasasasaaa,
I hope you are doing well today and thanks for sharing the website link.
Upon checking the asset files I confirm everything is ok and Cache-Control max-age value is the same as in your settings.
Please let us know if you need further help or clarification on this.
Kind regards,
ZaferHello, thanks ! I have sent you an image by mail.
Hi @sasasasaaa
?If I choose the url and not a css (like you) no cache is set.
Thanks for sharing the page URL. ?That is the expected behaviour, the Browser cache will only work for CSS, JS, image files etc as stated in the initial response.
?
You can enable the page cache under Hummingbird > Caching > Page cache and it should automatically??add?Cache Control to pages.Please do let us know if you have any further queries.
?
?Regards,
?NithinHi?@sasasasaaa,
We haven’t heard from you in a while, we will go ahead and mark this thread as resolved. If you have any additional questions or require further help, please let us know!
Kind regards,
Zafer
- The topic ‘expire headers code from hummingbird not working – other code ye’ is closed to new replies.