0

For reasons only my past self knows I put a 301 redirect in place to force all traffic to example.org from www.example.org. Put simply it dropped the www. subdomain.

Now I would like to change it so that all traffic goes to the www. subdomain, which would be problematic as any cached 301s in user's browsers would send the user into a redirect loop.

So I am planning on buying an SSL certificate and encrypting all traffic on the site - for other reasons too. If I redirect the users to https://www.example.org/ will it still cause the browser to look at it's cache and go into a redirect loop again?

To my mind https://www.example.org is a different URL to http://www.example.org, but do all the browsers see it this way for caching purposes?

  • 1
    I don't think this would cause a "redirect loop"? (Have you experienced this and the browsers cache was the problem?) I would have thought this might result in two redirects - at worst - so I can't see this being a problem? – MrWhite Aug 8 '14 at 13:30
1

I need to double check the specifications, but I am pretty certain that cached objects depend on the request method.

So an object using HTTP would be a different cache entity from HTTPS.

So if you are redirecting to HTTPS, there should be no prior cache data.

Also, you may want to consider using lower cache periods and requiring validation prior to the change:

Cache-Control "max-age=3600, must-revalidate"

This should force the user agent to revalidate the content and pick up your changes faster - even if there's a caching issue.

Note that this is controlled on the client side, so various browsers/user-agents could behave differently.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.