Hello!
I believe W3TC excludes the sitemap endpoint, whereas Surge is agnostic of such requests.
If the exclusion hadn’t been in W3TC, the problem might have surfaced with that, too.
I mean, how can the autor of the SEO plugin have an influence on caching referring a different plugin�
In PHP, any plugin can affect buffer behavior. Surge relies on those buffers to capture full-page output for storage.
The SEO Framework clears those buffers on the sitemap page to prevent poorly coded plugins and themes from introducing erroneous code that can render the sitemap invalid. This clearing in TSF stops Surge from operating as intended.
This buffer-clearing isn’t something TSF should have to do. However, I still have to ensure proper output. I’ve dealt with dozens of complaints until I decided this was a necessary feature. This is where Konstantin and I disagree.
Anyway, I have an update scheduled in January.
If you cannot wait until then, I already tried and tested this proposed method in a filter:
add_action(
'the_seo_framework_sitemap_header',
function () {
defined( 'DONOTCACHEPAGE' ) or define( 'DONOTCACHEPAGE', true );
},
);
(Where do I place filters?)
That filter won’t conflict with the upcoming update, but it will be rendered redundant.
You may need to clear the cache before it takes effect. Deactivating the plugin to clear the cache didn’t work for me (Apple Silicon Tahoe 26 via LocalWP, PHP 8.4); I had to delete the cache folder in wp-content.
-
This reply was modified 4 months, 2 weeks ago by
Sybre Waaijer. Reason: Coding standards