Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jul 1, 2017

Conversation

Projects
None yet
3 participants
Contributor

donnchawp commented Jun 28, 2017

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.

@donnchawp donnchawp Set is_feed/feed so sitemap can be identified later in shutdown funct…
…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.
4c597df

@donnchawp donnchawp requested review from eliorivero and dereksmart Jun 28, 2017

@eliorivero

LGTM 🐑

@eliorivero eliorivero added this to the 5.1 milestone Jul 1, 2017

Member

dereksmart commented Jul 1, 2017

thanks @donnapep!

@dereksmart dereksmart merged commit bfc70e0 into master Jul 1, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dereksmart dereksmart deleted the fix/make-sitemap-a-feed branch Jul 1, 2017

@eliorivero eliorivero added a commit that referenced this pull request Jul 1, 2017

@donnchawp @eliorivero donnchawp + eliorivero Set is_feed/feed so sitemap can be identified later in shutdown funct…
…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.
0c9e922
Contributor

eliorivero commented Jul 1, 2017

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