Skip to content

Set is_feed/feed so sitemap can be identified later in shutdown#7397

Merged
dereksmart merged 1 commit into
masterfrom
fix/make-sitemap-a-feed
Jul 1, 2017
Merged

Set is_feed/feed so sitemap can be identified later in shutdown#7397
dereksmart merged 1 commit into
masterfrom
fix/make-sitemap-a-feed

Conversation

@donnchawp
Copy link
Copy Markdown
Contributor

Identify sitemaps as a "sitemap" feed for the purposes of caching or further analysis of an output buffer.

Caching plugins use output buffering to capture the page so even though the sitemap function dies immediately after the content is pushed out, the content is still captured. However, in my testing the Content-Type header was not captured (even when using apache_get_header_list or headers_list) in the output buffer callback. With this change the caching plugin can identify a sitemap and then use the right caching and/or content type. This is how WP Super Cache does that.
See Automattic/wp-super-cache#237 for further
discussion.

…ions.

Caching plugins will be able to query is_feed() and then check the query
variable "feed" for the type of feed before creating a cache file of the
sitemap.
See Automattic/wp-super-cache#237 for further
discussion.
@dereksmart dereksmart added [Feature] Sitemaps [Status] Needs Review This PR is ready for review. Bug When a feature is broken and / or not performing as intended labels Jun 28, 2017
Copy link
Copy Markdown
Contributor

@eliorivero eliorivero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐑

@eliorivero eliorivero added this to the 5.1 milestone Jul 1, 2017
@eliorivero eliorivero added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Jul 1, 2017
@dereksmart
Copy link
Copy Markdown
Contributor

thanks @donnapep!

@dereksmart dereksmart merged commit bfc70e0 into master Jul 1, 2017
@dereksmart dereksmart deleted the fix/make-sitemap-a-feed branch July 1, 2017 13:37
eliorivero pushed a commit that referenced this pull request Jul 1, 2017
…ions. (#7397)

Caching plugins will be able to query is_feed() and then check the query
variable "feed" for the type of feed before creating a cache file of the
sitemap.
See Automattic/wp-super-cache#237 for further
discussion.
@eliorivero
Copy link
Copy Markdown
Contributor

Cherry picked to 5.1 in 0c9e922

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Feature] Sitemaps Touches WP.com Files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants