• Resolved Manny

    (@thewebnerd)


    I tried excluding XML sitemap pages from being cached as recommended by you guys but they are not working when using the excludes on sg optimizer.

    Is there a filter I can use for this? I want to exclude all xml sitemap pages( domain.com/sitemap.xml, domain.com/sitemap_index.xml, domain.com/page-sitemap.xml, domain.com/page-sitemap.xml etc.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Oyr Dynamic Caching caches URLs and not files. It is an NGINX reverse proxy that works based on headers. If an URL has to be cached, it must have the proper header. If it must be excluded or the cache busted – different headers. A single file does not posses those, it’s not being processed by the WordPress and the SG Optimizer plugin and is not cached by the Dynamic Caching.

    This said, if you’re on Site Tools, you have the NGINX Direct Delivery optimization which handles static files including XML. By default, we cache XML files for 1 hour.

    If you want to remove that cache, you need to disable the NGINX Direct Delivery and add a rule like that in your .htaccess file:

    ExpiresByType text/xml “access plus 0 seconds”
    ExpiresByType application/xml “access plus 0 seconds”

    This said, I will discuss it with our DevOps team in order to change the defaults of that value and lower the 1 hour cache to something like 5 minutes because it shouldn’t be fully dynamic in case some plugin goes crazy.

    Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    If you’re on cPanel, just edit your .htaccess file chaning the default cachiing time for these.

    Thread Starter Manny

    (@thewebnerd)

    Thanks for replying.

    The problem is that that those expire rules you mentioned to add is already in the .htaccess.

    Can’t you guys just add this ^/(.*)sitemap(.*).xml on the nginx ( this is what wp engine did for us for our other sites hosted there which resolved the issue)?

    Also, i lowered the rss+xml and atom+xml to 600 seconds instead of 1 hour to see if that will help and that doesn’t work. Do you think lowering it to 0 will?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I am Having Issue with No Caching Sitemap pages’ is closed to new replies.