Caching Everything Page Rule doesn't work if you have another redirect page rule before it

#1

I am on a free cloudflare plan. I have a redirect page rule setup for one of the pages before the Cache Everything page rule, in this scenario Cache everything isn’t working. But, if I place the Cache everything page rule before the redirect page rule, then it works but the redirect page rule doesn’t. I am in a tough situation, any suggestions.

0 Likes

#2

I’m a bit fuzzy if Page Rules will loop back around on the second hit after a redirect. It sounds like it won’t.

One option would be to add the redirect on your server.

0 Likes

#3

This is that way by design. The redirect however does not require caching so it should be fine being first. Can you post a screenshot of the two rules?

1 Like

#4

With a redirect rule the user is being redirected to another page/URL so there is nothing to cache. The caching should be done for the target of the rule. If I have a rule which says www.example.com/blog -> 301 redirect -> blog.example.com the only response a user gets when they visit www.example.com/blog is a 301 which tells their browser to make another request to the new URL. The browser makes that second call directly, Cloudflare isn’t doing it on their behalf.

If you want to cache blog.example.com once they have been redirected you would create a rule to cache that.

1 Like

closed #5

This topic was automatically closed after 31 days. New replies are no longer allowed.

0 Likes