Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Tsvetan Mitev

    (@tsvetanm)

    Hello @generosus,

    The XML sitemaps are excluded from optimizations, but the URLs are still being dynamically cached.

    If you need to exclude certain sitemap URLs from your website being cached you can use the exclude filter in SiteGround Optimizer (Exclude URLs from Caching).

    The filter only accepts wildcard excludes. For example you can exclude the sitemap URL as:
    example.com/sitemap*

    Alternatively, you can use the following function in your website code to exclude specific URLs from the cache:

    add_filter( 'sgo_exclude_urls_from_cache', 'sgo_add_excluded_urls_from_cache');
    function sgo_add_excluded_urls_from_cache( $excluded_urls ) {
        // The part of the URL which needs to be excluded from cache.
        $excluded_urls[] = '/excluded_url/';
        $excluded_urls[] = '/wildcard/exclude/*';
    
        return $excluded_urls;
    }

    Currently XML file type is not cached by the NGINX Direct Delivery, but if you wish to set a custom TTL for a specific file type, such as XML you will need to disable the NGINX Direct Delivery:
    https://www.siteground.com/tutorials/supercacher/nginx-direct-delivery/

    and set the custom expire rule in your website .htaccess using the ExpiresByType directive.

    Best Regards,
    Tsvetan Mitev

    Thread Starter generosus

    (@generosus)

    Hi @tsvetanm,

    Perfect. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Does SGO Cache Sitemaps?’ is closed to new replies.