Mobile app version of vmapp.org
Login or Join
Angela700

: Disabling If-modified-since / if-none-match on web server for some files What I want to do is try to get search engines to rescan my sitemap files (plain xml files stored on server). It did

@Angela700

Posted in: #Apache #Http #HttpdConf

What I want to do is try to get search engines to rescan my sitemap files (plain xml files stored on server). It did recently attempt to access it but it received a not modified response (HTTP status 304) from the server.

Is there any configuration setting I can apply to apache so that any future requests to successful xml files return HTTP status 200 (regardless of if the browser issues a if-modified-since or if-none-match header or not) instead of HTTP status 304?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

2 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera270

Let me make your question a little simpler.. :)

What ?


Send 200 response instead of 304


How ?

Just add this configuration in your Apache setup.

<filesMatch ".(xml)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>


Why ?


Setting this in your configuration would send header not to cache this file i.e. sitemap.
When sitemap isn't cached, the downloader (in this case the bot), would download file again and again, instead of just reading HEADER and leaving with 304.

10% popularity Vote Up Vote Down


 

@Eichhorn148

I think, like this would help:

<FilesMatch ".(xml)$">
ExpiresDefault A14515200
</FilesMatch>

<files sitemap.xml>
Header set last-modified "Sun Jul 00:00:00 EDT 2015"
</files>


But i haven't tried, which answer code would have the sitemap.

Another way is to update your sitemap with help of Search Console API, like here:

developers.google.com/webmaster-tools/v3/sitemaps/submit

PS: after i read your question twice, i think, these topics would be helpful too:

webmasters.stackexchange.com/a/25352/43910 https://stackoverflow.com/a/22389353/1992004

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme