Exclude “301 Moved Permanently” from caching
-
Hello ,
I’ve a problem with caching 301 redirection response.
Everything is working fine with W3TC deactivated. Everything is working OK for logged in users (“Don’t cache pages for logged in users” is checked).
I’ve tried to exclude pages, .php files, .js files and still haven’t solved this for a week.
I’ve a page with images that are linked to the different quizes (using “Gallery Custom Links”). Click on a link open a new page with the quiz. In a cache I see two rows for quiz page.
Here are the rows with W3TC deactivated.
…./kviz/kviz-i-nivo/crvenkapa/ 21622 bytes 1 2020-06-21 21:25:34 Expired Immediately
…./kviz/kviz-i-nivo/crvenkapa 0 bytes 1 2020-06-21 21:25:31 Expired ImmediatelyZero bytes is redirection (“response-head: HTTP/2 301 Moved Permanently”).
When I activate W3TC I’ve this situation:
…./kviz/kviz-i-nivo/crvenkapa/ 16959 bytes 1 2020-06-21 21:37:03 2020-06-21 21:42:00
…./kviz/kviz-i-nivo/crvenkapa 0 bytes 1 2020-06-21 21:37:03 2020-06-21 21:41:59As you can see cookies are cached for five minutes and every run of a quiz will give me the same questions.
I was able to make some progress changing Browser Cache -> HTML & XML -> Set cache control header -> Cache Control Policy: no-cache(“max-age=0, private, no-store, no-cache, must-revalidate”)
…./kviz/kviz-i-nivo/crvenkapa/ 16979 bytes 1 2020-06-21 21:45:21 Expired Immediately
…./kviz/kviz-i-nivo/crvenkapa 0 bytes 1 2020-06-21 21:45:18 2020-06-21 21:50:17I’m still getting the same questions because of this cookie for redirection:
request-method: GET
request-Accept-Encoding: gzip, deflate, br
response-head: HTTP/2 301 Moved Permanently
date: Sun, 21 Jun 2020 19:45:18 GMT
server: nginx/1.19.0
content-type: text/html; charset=UTF-8
content-length: 0
x-powered-by: W3 Total Cache/0.13.3
x-redirect-by: WordPress
vary: Accept-Encoding
location: …….
cache-control: max-age=300How can I change this? I need max-age to be zero or to expire immediately.
For the first row above (real page – 16979 bytes) I can see that changes that I’ve made in W3TC are applied:
pragma: no-cache
cache-control: max-age=0, private, no-store, no-cache, must-revalidateBest regards,
Branislav…
The page I need help with: [log in to see the link]
- The topic ‘Exclude “301 Moved Permanently” from caching’ is closed to new replies.