Hello @hardbuz
Thank you for your inquiry and I am happy to assist you with this.
3. Requesting the page using the if-modified-since header – we get a 304 response and a blank page – CORRECT.
4. BUT the page adds to the cache. The second time we request the page with the usual GET – we get a blank page and a 304 response.
Can you please clarify this a bit? Are you getting the 304 or 200 responses for the page?
Thanks!
Maybe:
ORDINARY SCENARIO
1. There is no cache.
2. The first simple request to the page. The answer is 200.
3. The cache is created.
4. The second simple request to the page. The answer is 200.
RIGHT
UNUSUAL SCENARIO
1. There is no cache.
2. First request with “IF_MODIFIED_SINCE”. The answer is 304, a blank page. RIGHT.
3. The cache is created.
4. The second simple request to the page, without “IF_MODIFIED_SINCE”. The answer is 304, a blank page. WRONG (!!! Should be 200 with any data from original page).
Hope it could clarify the situation)
Hello @hardbuz
Thank you for the information.
Can you please share your Performance>Browser Cache settings, specifically for HTML&XML?
Thank you!
Sure. Original settings without my tests:
https://imgur.com/a/GuaUXyl
Hello @hardbuz
When Server returns Last-Modified: header with a timestamp, and you include If-Modified-Since: header in future requests. In case the file hasn’t changed since the given date, the server replies with an HTTP 304 Not Modified response.
As you can see you’ve set the Last-Modified header to enable 304 Not Modified response.
Thanks!
Hello, @vmarko
Ok. Let’s make changes to our settings:
1. Disable Last-Modified header in W3TC:
https://imgur.com/a/Wog7jNG
2. Clear the W3TC cache.
3. Request the page at the first time with IF_MODIFIED_SINCE header (for example, simulate a search robot or browser request).
4. Result – 304 with a blank page – CORRECT (only for request with IF_MODIFIED_SINCE).
But this page is written to the W3TC cache – it gives it away even with requests without IF_MODIFIED_SINCE to a normal user. And this user sees a white screen (and search engines also see this screen):
https://imgur.com/ToIi8GT
My problem is that the W3TC caches this 304 response as a regular page and leaves it blank on further requests. And I don’t know what to do with this ( Thanks.
Hello @hardbuz
I am checking this. I’ll get back to you when I have more information.
Thanks!
Hello @hardbuz
I’ve spoken with the team od devs and tested this. The problem is with the cross plugin incompatibility. The mentioned plugin should define DONTPAGECACHE constant when the response shouldn’t be cached. This is basically caching of caching setup and W3 Total Cache is enough.
Thank you!
Hello @vmarko
Thanks! This is a great solution.
Correct – DONOTCACHEPAGE
You are most welcome!
We would really appreciate it if you could take a minute and post a review here. This will help us to continue offering a top-notch product to users.
Thanks!