Question

Is there a way to stop Cloudfront caching sitemap files that are changing hourly?

The files live on an nginx server so maybe something can be done there around expiry.

Maybe:

location ~* \.(xml)$ {
  expires -1;
  log_not_found off;
}

The files are standard files like

www.site.com/sitemap.xml
www.site.com/sitemap1.xml.gz
www.site.com/sitemap2.xml.gz
www.site.com/sitemap3.xml.gz
www.site.com/sitemap4.xml.gz

Any advice would be greatly appreciated... thx

No correct solution

OTHER TIPS

Based on the CloudFront documentation, http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html#ExpirationDownloadDist, you should be able to accomplish this with a Cache-Control or expires header. Do you have an example where this is not working?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top