Firefox ignore my Cache-Control config and keep caching the webpage - firefox

We have a Wordpress based website that use <meta> to allow front-end retrieve the user's login status. However, it seems like not working properly on Firefox. Firefox keep caching the webpage even we have cache-control: no-cache, no-store, must-revalidate setup. I have tried few suggested solutions and none of them works on Firefox but works on Chrome and Safari. Here are the solutions I tried
# In the header of the page (Firefox just remove it from the page)
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="Sat, 26 Jul 1997 05:00:00 GMT" />
# From php
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
# Apache config
Header always set Cache-Control "no-cache, no-store, must-revalidate"
You can visit this page on different browsers and see the response headers in the Web dev tool. My result from:
Firefox and my result from Chrome.
Open to any suggestion, thanks much for help.

After the investigation, it's due to the Cloudflare. Not sure why it only effect Firefox, but after DevOps team modify the config on Cloudflare, the issue is fixed.

Related

Cache control and Meta cache control

Question about how browsers understand cache control and meta cache control tags
If i have something like this:
Cache-control: no-cache, no-store
and later i have
< meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate, max-age=0, s-maxage=0" />
Which cache control is applied to the page? Does it work in the same way in all the browsers?
Thanks

How to clear page cache when hitting back button on browser (IE,Chrome,Firefox Safari)?

How to clear the cache of browser when hitting the back button on browser (IE,Chrome,Firefox Safari) In MVC4.tried with the following code but its not working
How to refresh page when hitting back button on browser (IE,Chrome,Firefox Safari)?
Can you guys help me out to do this.
Thanks,
Subhnai.
You need to tell browser to discard old page and fetch latest from server by specifying it in HTML > Head
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate" />

In codeigniter, After login if I click the browser back button, I got back to the login page

I have created a login page where my first line is if session->userdata() exist then redirect to home. But after login when I click the back button, I get back to the login page. I expected that my session check will work but it's not, any help?
i think this may help you.
add this in to your controller function to prevent caching of previous page
header("cache-Control: no-store, no-cache, must-revalidate");
header("cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

Edit Rewrite URL in Sharepoint 2013

I am using sharepoint 2013 version and hosted a site on sharepoint server.. I am using below code and saved in index.htm and make it default page.
<html>
<head>
<title>Redirecting...</title>
<meta http-equiv="REFRESH" content="0;url=http://www.yoururl.com">
</head>
<body>
</body>
</html>
Due to this, URL is only working when i type http://www.yoururl.com/index.htm i am looking it should work without index.htm .
Showing the below error
HTTP/1.1 200 OK
Server: Microsoft-IIS/8.0
Date: Fri, 31 Jan 2014 10:44:11 GMT
Connection: close
Any help or suggestion ?
Many Thanks
Url rewriting is a server side configuration. Depending on the hosting, you can or cannot infuence rewrite urls engine. It is hardly possible to influence it from index.htm.

htaccess caching for specific file extensions?

I'm trying to optimize my site using yslow and I scored an F for "Add Expires Headers" I currently have my index page set to no-cache for users logging in so my question is, is it possible to add a filematch for other file types like images, css, and js to my htaccess file?
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"/> <!-- Important for security -->
<META HTTP-EQUIV="Expires" CONTENT="-1"/>
If so will this impact or override my no-cache setting?
Thanks,
-Paul
Have a read of the section that starts "Never Expire" Policy in Chapter 3 of the Book of Speed - http://www.bookofspeed.com/chapter3.html

Resources