Skip to content

Only cache pages with a 200 status code#50

Closed
daltonrooney wants to merge 1 commit into
tlovett1:masterfrom
daltonrooney:only-cache-200s
Closed

Only cache pages with a 200 status code#50
daltonrooney wants to merge 1 commit into
tlovett1:masterfrom
daltonrooney:only-cache-200s

Conversation

@daltonrooney

Copy link
Copy Markdown

We are using a security plugin (WordFence) that sometimes limits access
to specific IP addresses by returning a page with a 'Status: 503
Service Temporarily Unavailable' code. The problem is that it seems
like this page is getting cached and then served to other users as well.

We are using a security plugin (WordFence) that sometimes limits access
to specific IP addresses by returning a page with a 'Status: 503
Service Temporarily Unavailable' code. The problem is that it seems
like this page is getting cached and then served to other users as well.
@tlovett1

Copy link
Copy Markdown
Owner

http_response_code is PHP 5.4+. We need to support 5.2. Also, I don't know when exactly the status code gets set. It probably makes more sense to see IF a status code has been set, THEN it must be 200.

@ghost

ghost commented May 16, 2017

Copy link
Copy Markdown

Maybe also consider allowing status code 304 (Not modified) for effective caching, IF that doesn't introduce any new eff-ups :)

@szepeviktor

Copy link
Copy Markdown

@daltonrooney You may write a 3-liner MU plugin to hook WordFence and overwrite $GLOBALS['sc_config']['cache_exception_urls']

Later you may define DONOTCACHEPAGE.

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

Labels

None yet

3 participants