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!

본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Page always loads from cache unless refreshing

  • 2 답장
  • 1 이 문제를 만남
  • 2 보기
  • 최종 답변자: 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?

모든 댓글 (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.