Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] sitemap.xml and sitemap-news.xml not being cached

  • I am using the XML Sitemap & Google News Sitemap Feeds plugin ( for generation of my sitemap.xml and sitemap-news.xml file.

    The sitemaps are being generated successfully, but WP Super Cache is not caching them. Instead of creating a cache file, as I would expect, an empty directory is created under my cache domain directory (/public_html/wp-content/cache/supercache/

    WP Super Cache is caching the rest of my site correctly, just not the sitemap files.

    I am running WordPress 3.2.1, WP Super Cache .9.9.9 and XML Sitemap & Google News Sitemap Feeds 3.9.1

    Any suggestions would be greatly appreciated!

Viewing 13 replies - 1 through 13 (of 13 total)
  • You need to check the option “Late init” in WP Super Cache to get the feed cached. This works even in mod_rewrite mode so – as I understand it – the performance of normal posts/pages should not be affected.

    By the way, checking late init seems necessary for all feeds (not just the sitemap feed) to be cached but it is not documented as far as I know… Donncha?

    Plugin Author Donncha O Caoimh


    skippybosco – use the debug system in the plugin to figure out why the sitemaps aren’t caching.

    RavanH – you shouldn’t need to enable late init. I think there may be some issue with feeds. I’ll have to check.

    Thanks for the responses guys.

    @ravanh: Late Init does not seem to change anything for me.

    @donncha: I ran debug with two loads of the sitemap.xml:

    First Request:

    01:11:43 /sitemap.xml supercache dir: /home/domain/public_html/wp-content/cache/supercache/
    01:11:43 /sitemap.xml No wp-cache file exists. Must generate a new one.
    01:11:43 /sitemap.xml In WP Cache Phase 2
    01:11:43 /sitemap.xml Setting up WordPress actions
    01:11:43 /sitemap.xml Created output buffer
    01:11:45 /sitemap.xml Output buffer callback
    01:11:45 /sitemap.xml Supercache disabled: GET or feed detected or disabled by config.
    01:11:45 /sitemap.xml Writing non-gzipped buffer to wp-cache cache file.
    01:11:45 /sitemap.xml Renamed temp wp-cache file to /home/domain/public_html/wp-content/cache/wp-cache-d8d99752c11a1403b6cd78bb357c1552.html
    01:11:45 /sitemap.xml Sending buffer to browser
    01:11:45 /sitemap.xml wp_cache_shutdown_callback: collecting meta data.
    01:11:45 /sitemap.xml Writing meta file: /home/domain/public_html/wp-content/cache/meta/wp-cache-d8d99752c11a1403b6cd78bb357c1552.meta
    01:11:50 /sitemap.xml wp-cache file exists: /home/domain/public_html/wp-content/cache/wp-cache-d8d99752c11a1403b6cd78bb357c1552.html
    01:11:50 /sitemap.xml Serving wp-cache static file
    01:11:50 /sitemap.xml exit request

    Second Request:

    01:12:27 /sitemap.xml wp-cache file exists: /home/domain/public_html/wp-content/cache/wp-cache-d8d99752c11a1403b6cd78bb357c1552.html
    01:12:27 /sitemap.xml Serving wp-cache static file
    01:12:27 /sitemap.xml exit request

    Cache file was at a different location than I expected, probably because it is being cached, but not super cached.

    1. Is it possible to have the sitemap/feed files supercached?

    2. This is a great example of where it would be nice to be able to set different expiration dates for different types of content ( Posts may expire @ 300 sec whereas our sitemap files can live as long as 3600 sec.

    Hi Donncha, what I had noticed is that without late init checked, the feed timestamps change on each request whereas with late init, the timestamps remain the same. On the other hand, with late init, there is no Last-Modified response header…

    In both cases, response headers show:

    Expires:	Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control:	no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma:	no-cache

    even though I have checked the option 304 Not Modified browser caching.

    Is it best to ignore the differences in date stamps and trust the Last-Modified header to do it’s work in spite of the no-cache directive?

    You can see it happening on where I have WP Super Cache in PHP mode with 304 Not Modified browser caching on and lite init switched off again.

    Plugin Author Donncha O Caoimh


    I just fixed the code that detects multisite installs and that appears to have fixed caching of the sitemap on my own server. Is your site a multisite one? That may be it.

    Go grab the dev version in about 20 minutes, it should have updated by then!

    Hi Donncha, is the sitemap legacy cached or super cached on your server? On my Multi-site install, all feeds (inlcuding the sitemap feed) are still ‘only’ legacy cached. Time-stamp behaviour (differing after each request) did not change either. Nor the Expires/Cache-Control/Pragma response headers…

    Plugin Author Donncha O Caoimh


    Legacy caching only because of the headers required.

    Not sure why it doesn’t work for you. That’s annoying. I’ll have to look at it again when I have a chance.

    No, I spoke too soon and I think because of upgrading without being able to completely clear the cache for all sites in the network (see my other post on this forum) I was looking at old cached files. Could that be it? In any case, now that some time has passed it seems the timestamps stick to on time on every request and on every site…

    Only the Expires/Cache-Control/Pragma response headers remain like before but this time with the extra WP-Super-Cache header:

    Expires:	Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control:	no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma:	no-cache
    WP-Super-Cache:	Served legacy cache file

    Hi Donncha

    Does your pluggin cache all pages and posts, dynamic and static, in an XML sitemap?

    Plugin Author Donncha O Caoimh


    NaplesFlorida – it caches whatever pages are visited by visitors, or have been “preloaded” by the plugin.

    Hi Donncha

    I have over 20,000 dynamic URL’s in my sitemap.

    I need the all pages to be pre-cached.
    Is there a way to do that or is it being done already out of the box?

    Plugin Author Donncha O Caoimh


    You can use the “Preload” functionality of the plugin to cache all those pages ahead of time.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: WP Super Cache] sitemap.xml and sitemap-news.xml not being cached’ is closed to new replies.