Plugin Contributor
iSaumya
(@isaumya)
Hi,
Inside the plugin settings under the cache tab if you scroll down you can enable the option to add cache-control header for static files.
When cache-control header is being used expires header (which is already ancioent and deprecated) is not needed.
Are you referring to: Add browser caching rules for static assets? Currently that is already set to Yes.
For my clarification, you are saying that if that option is enabled that I really do not need to add expired headers section to htaccess file?
If I must add expires headers for RankMath plugin (asking support now),
- I would need to disable cache control headers
and
- add expires headers to htaccess. Where do they need to be added in the htaccess file? My hosting provider added them after the SuperPage Cache for Cloudflare settings but was wondering if they should be beforehand?
Your prompt replies are appreciated. Thank you.
Plugin Contributor
iSaumya
(@isaumya)
If cache-control header is present then you don’t need expires headers. Link: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires (read the note).
Can you share your website URL so that I can check the response headers for the static files?
AFAIK, your plugin has been working perfectly for my website at NatureInFocus.com. It is only the RankMath which gives me a warning for not using expires headings which sounds like may be meaningless.
Plugin Contributor
iSaumya
(@isaumya)
Yes I can confirm that your static files have proper cache-control header. So, you can ignore the rankmath message.
Thanks for your help. For the benefit of others, here is what RankMath support said. I bolded the parts that really matters:
We’ve checked your site and found that your server is using a newer implementation called cache-control, but our system cannot detect those and as such it fails this test. That won’t have any negative impact on SEO, and you can simply ignore the error on the SEO Analysis report.
In simple words, you have the Expires Headers for your images, but with a different implementation which Rank Math can’t detect yet and you can avoid the error on your SEO analysis.
Plugin Contributor
iSaumya
(@isaumya)
Yes, exactly what I said.