Support » Plugin: WP Super Cache » Regression in 1.4.9 for Yoast sitemap_index.xml

  • Resolved Laurent

    (@lolobu)



    Hello,

    There is been a minor regression with the version 1.4.9 when used with the plugin Yoast SEO. When WP Super Cache is enabled, eventhough the sitemap_index.xml file is not cached, it doesn’t display as it should.
    I don’t really undertand what’s going on since the XML file generated is the same, but when WP Super cache is activated, the XML stylesheet fails to load and the XML file is just displayed as text.
    Here is an exemple:
    – My sitemap that doesn’t display properly with WP Super Cache 1.4.9 : https://onechai.fr/sitemap_index.xml
    – Another sitemap that displays as it should : https://yoast.com/sitemap_index.xml

    When reinstalling WP Super Cache 1.4.8, the problem dissapear, so it really seems to be a regression introduced in 1.4.9.
    With WP Super Cache 1.4.9, if I disable the WP Super Cache, the sitemap display as it should again.
    I’ve tried different config of WP Super Cache, but it doesn’t make any difference. I’m using WP Super Cache in rewrite mode.

    The XML is still correct and well understood by Google crawlers, but it’s a bit annoying that it’s not really readable anymore.

    I found another person with the same issue (in the bug report https://wordpress.org/support/topic/sitemap_indext-is-not-displayed-correctly/) and as you can see from the footer of its xml file (http://borjamerino.es/sitemap_index.xml), he is also using WP Super Cache.

    Thanks for the support…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    I had the same issue between Yoast SEO and WP Super Cache.
    When I searched in network flow, I saw sitemap_index.xml was sent with the content type text/html instead of text/xml.
    So the browser misunderstood the xml file, did not load main-sitemap.xsl and displayed xml files as a text file.

    I don’t know why wp super cache put this wrong content type.

    So I decided to exclude all sitemap xml files from wp super cache settings – in the exclude file field in advanced tab.

    I added this line => .*sitemap.*\.xml

    Hope this helps.

    Best Regards
    Emmanuel

    • This reply was modified 1 year, 11 months ago by  manooweb.

    Brilliant, thanks a million !
    I actually tried to do that when I figured out the problem, but I got it wrong somehow (I don’t know how !), because it didn’t work at that time, but now it does.
    I missed the fact that the content type was different when trying to figure out what was going on.
    Thanks again.

    I know this is for WP Super Cache, but it’s the only relevant thing I got to from google, after identifying that W3 Total Cache (even after update to Version 0.9.5.4) was doing the same – setting http instead of xml for content-type.

    So I thought I’d just leave the sollution here for anyone else that might get here from google, as “disable feed caching” checkbox does not work.

    Remove this section

    sitemap(_index)?\.xml(\.gz)?
    ([a-z0-9_\-]+)?sitemap\.xsl
    [a-z0-9_\-]+-sitemap([0-9]+)?\.xml(\.gz)?

    From the “Non-trailing slash pages:” and add it to “Never cache the following pages:” instead.
    You would find this in the “Page Cache” submenu.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Regression in 1.4.9 for Yoast sitemap_index.xml’ is closed to new replies.