Este site está com funcionalidades limitadas enquanto realizamos manutenção para melhorar sua experiência de uso. Se nenhum artigo resolver seu problema e você quiser fazer uma pergunta, nossa comunidade de suporte pode te ajudar em @FirefoxSupport no Twitter e /r/firefox no Reddit.

Pesquisar no site de suporte

Evite golpes de suporte. Nunca pedimos que você ligue ou envie uma mensagem de texto para um número de telefone, ou compartilhe informações pessoais. Denuncie atividades suspeitas usando a opção “Denunciar abuso”.

Saiba mais

Esta discussão foi arquivada. Faça uma nova pergunta se precisa de ajuda.

Page always loads from cache unless refreshing

  • 2 respostas
  • 1 tem este problema
  • 2 visualizações
  • Última resposta de 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?

Todas as respostas (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.