0

I have a sitemap.xml page which is dynamically generated by my Symfony application. I also use Varnish. I would like to know if it's a good idea to cache the sitemap.xml page or if it's useless?

Thanks.

unadivadantan
  • 363
  • 4
  • 14

1 Answers1

1

How often will it change? If it isn't changing on a minute-by-minute basis, but is being read often (and hence being generated often), then it's probably worth caching it. You may want some code to generate it offline and then invalidate the Varnish cache if a particular timeliness for a newly update file is required.

Alister Bulman
  • 34,482
  • 9
  • 71
  • 110
  • Thanks for your answer Alister. It's a CMS so it can often change. Like at least once in a day. My question was more about if the sitemap must be cached. We set the 'changefreq' to 1 day and only search engines request this page. Therefore, the traffic to this page is very low. But, even if it was changing every minute, I don't think we can have a lot of calls to this page. Maybe I'm wrong. But that's why I asked if it's useful to cache it. – unadivadantan Sep 06 '16 at 13:02
  • "But, even if it was changing every minute, I don't think we can have a lot of calls to this page." --- so what problem you're solving with caching it? – zerkms Sep 06 '16 at 20:56