• Resolved ittone

    (@ittone)


    Hi Guys

    I changed my wordpress hosting to WPX Hosting last week for my main site which has been live for eight years now, having been on three different hosting platforms, all using Apache2 webserver and for most of that time utilising W3TC’s disk enhanced mode. All other functions of W3TC have always been disabled. Browser cache, minify etc.

    I love this plugin’s cache speed which is a good partner for my site.

    Now on WPX hosting which I believe is a Lightspeed server, I noticed on my Google console that my sitemap for https://www.backtothemovies.com was producing HTML header information errors instead of XML.

    After submitting my sitemap_index.xml over the last week several times, Google sees the xml file correctly the first time, but after approximately ten minutes, the next time sitemap_index.xml is accessed the html header error shows.
    As soon as I remove the code from my htaccess file, the sitemap is once again seen as an xml file.

    All tests sitemap tests have been carried out from https://www.xml-sitemaps.com

    Since I am using the Yoast SEO sitemap, I disabled the sitemap function and installed “Google XML Sitemaps” and this plugin also produced the same html error read behavior.

    When using W3TC cache program in the basic DISK mode there are NO problems with seeing the sitemap as an xml file at any time.
    When using WP-optimize cache program there are NO problems with seeing the sitemap as an xml file at any time.

    BUT when using W3TC in disk:enhanced mode, the errors occur.

    After raising a ticket for investigation at WPX on this problem and them saying I was the first to raise this problem then it is something to do with my plugins or .htaccess file that is causing the problem.

    The same plugins and htaccess file is the same as used on my previos host being Siteground….No issues in over four years.

    Now, I am using temporally a cache plugin that isn’t too bad (wp-optimize), but I still prefer W3TC in enhanced cache mode.

    So here is hoping you can look into my problem please and advise accordingly, as WPX hosting have now washed their hands of it.

    Unable to attach two w3tc config files for you to look at.

    Yoast sitemap_index.xml is being utilised.

    If you need me to do anything on the site, please let me know.

    Thank-you.

    The page I need help with: [log in to see the link]

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

    Krasimir from WPX here.

    I have managed to replicate the issue in a controlled environment abd a 100% replication chance.

    Based on my tests the mime-type of the sitemap is handled as HTML instead of XML only when the “Cache feeds: site, categories, tags, comments” is toggled: https://wpx.page.link/Hh5j

    The quickest fix that I found was to toggle the “Handle XML mime type” option and clear the cache manually: https://wpx.page.link/ZPsR

    The issue will most likely occur to advanced users and such that want to experimenter with the plugin settings but they will end up with a broken sitemap due to the live(non-broken cache).

    Note: You have to manually clear the disk cache via ssh/ftp in order to replicate it.

    The steps that we took were:

    1. Enable Page Caching and “Cache feeds: site, categories, tags, comments”
    – This seems to automatically enable the “Handle XML mime type”.
    2. Disable the “Cache feeds: site, categories, tags, comments”
    3. Clear the cache manually via SSH/FTP
    4. Refresh the sitemap of the site twice.
    – You end up with conten-type header of text/html: https://wpx.page.link/aCVq
    – The cache debug option shows text/xml but the browser doesn’t handle the comments: https://wpx.page.link/yZ6c

    Based on my understanding and competency I can tell that the issue occurs because of the removal of this .htaccess rule:

    
    < RewriteCond %{REQUEST_METHOD} !=POST
    < RewriteCond %{QUERY_STRING} =""
    < RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    < RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.xml%{ENV:W3TC_ENC}" -f
    < RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_SSL}%{ENV:W3TC_PREVIEW}.xml%{ENV:W3TC_ENC}" [L]
    

    There might be something else but I cannot confirm it at the moment.

    Thanks,

    Krasimir
    Security and Optimization at WPX

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @m0sh1x2

    Thank you for the information.
    I’ve tried to replicate the issue on my end but I was unable to. So it seems it depends on the environment.
    However, you are correct when you say that enabling Handle XML mime-type solves the issue and returns the correct Content-Type header for XML files so it should be enabled in cases such as this.
    Thanks!

    HI,

    Same thing happened to me , I’m using yoast seo plugin and W3 cache together.

    When I submit post-sitemap.xml with W3 cache activated , Google search console shows shows Couldn’t fetch.

    When I deactivate W3 cache and submit sitemap_index.xml again , the status shows success.

    https://i.ibb.co/mqtWMB2/Screen-Shot-2020-12-31-at-11-06-14-AM.png

    I’ve set Never cache the following pages in page cache , database cache , object cache , minify and browser cache:

    [a-z0-9_\-]*sitemap[a-z0-9_\-]*\.(xml|xsl|html)(\.gz)?
    ([a-z0-9_\-]*?)sitemap([a-z0-9_\-]*)?\.xml

    This is my website :
    https://hdkdive.com.tw/
    sitemap url:
    https://hdkdive.com.tw/sitemap_index.xml

    • This reply was modified 3 years, 11 months ago by ericcool.
Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Sitemap errors when in enhanced cache mode’ is closed to new replies.