Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Page always loads from cache unless refreshing

  • 2 replies
  • 1 has this problem
  • 2 views
  • Last reply by divunij

more options

I am testing my website with Firefox, and came across a strange situation that i haven't found an answer to yet, and havent encountered in any other browser.

When I navigate through the website by clicking on links, the pages I visited are stored in cache and are always the ones to be loaded, even when going back to the same page VIA a link.

For example, on the homepage of the site there is a feed with the recent content updates, these content updates are pulled from the database, loading the page loads the last 20 items. Currently, the only way to see the updated page though is if i either click the refresh button, or if i do ctrl+r or any other manual refresh.

What is expected is that if I click on the link to go to the homepage, the home page will be loaded from the server, not from the cache, otherwise the pages are just not up to date.

This is happening with all of the pages, which means that if someone goes throught the website once, they will always see the same old data because none of the pages are pulled from the server after being viewed once. I find myself always having to refresh every page to see if there is an update, rather than just being able to go to that page by clicking on a link to it.

Is there any information on this or a way to fix this?

I am testing my website with Firefox, and came across a strange situation that i haven't found an answer to yet, and havent encountered in any other browser. When I navigate through the website by clicking on links, the pages I visited are stored in cache and are always the ones to be loaded, even when going back to the same page VIA a link. For example, on the homepage of the site there is a feed with the recent content updates, these content updates are pulled from the database, loading the page loads the last 20 items. Currently, the only way to see the updated page though is if i either click the refresh button, or if i do ctrl+r or any other manual refresh. What is expected is that if I click on the link to go to the homepage, the home page will be loaded from the server, not from the cache, otherwise the pages are just not up to date. This is happening with all of the pages, which means that if someone goes throught the website once, they will always see the same old data because none of the pages are pulled from the server after being viewed once. I find myself always having to refresh every page to see if there is an update, rather than just being able to go to that page by clicking on a link to it. Is there any information on this or a way to fix this?

All Replies (2)

more options

I just realized where the issue is comming from, I still don't know how to handle it though.

I set up caching with this header: header('Cache-Control: private, max-age=86400');

I set it up to be able to take advantage of bfcache. The functinoality I expected from that was for the pages to be loaded from cache when the user presses the back/forward buttons. I did not expect that all pages would be loaded from cache in every case, even when going to them through a link.

So the question now is if there is a way to make it so that the pages will only be loaded from the cache if the user clicked the back/forward buttons?

more options

Well, i'm not sure if this is the correct way to fix it, but, if this helps anyone else, this helped me:

I change the Cacho control header to this: header('Cache-Control: no-cache, max-age=86400');

bfcache is working, and links are loading from the server.