Closed marcwiest closed 3 years ago
Hey guys any update on this PR? This really needs to be fixed asap.
Hi @isaumya This issue will be fixed in the next update for Rank Math. Until then, you can just fix it in your own copy by applying the same changes as in this PR. Hope that helps.
Hi @balazsmts, That's exactly what I wanted to hear as I've already made the manual changes inside the code even before the PR was pushed. So, if the fix is not added in the upcoming release I have to do it all over again for all of our client sites. :) Thanks. :)
Hey @balazsmts & @marcwiest,
I have been doing some thorough testing and found that when cache-control
is removed from the PHP, no matter how hard we try to add a cache-control
header using nginx or whatever it doesn't work as the sitemap_index.xml
file doesn't actually exists physically and instead generated by PHP.
So, I think instead of simply removing the cache-control
header we should add
'Cache-Control' => 'no-cache, no-store, must-revalidate, max-age=0'
Same thing for robots.txt
. As when that file is also getting generated dynamically via PHP using robots_txt filter there is no cache-control
header and adding a cache-control at the server rules doesn't help as to server the file doesn't exist and it is processed via PHP.
Closes/Fixes #61