Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

362
Visualizações
location.reload not updating page on remote server as it does locally

I am trying to reload the page after a POST request is complete with this line:

window.location.reload();

On my local machine this is updating the content on the page, meanwhile on my remote server where I use Nginx I have to force refresh the page.

I tried:

window.location = window.location
window.location.href = window.location.href
window.location.reload(true);
//reloading with a setTimeout function
//turning off the cache in nginx
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your browser may be caching certain remote files (CSS, JS) by default. You could configure Nginx to always check for a new file if exists. 304 Not Modified is returned if file is not changed or 200 OK is returned with the new file.

## Force browser to check for new JS & CSS files
location ~ .(css|js)$ {
  add_header Cache-Control no-cache;
  etag on;
}

Also, browsers' reloading behavior can be affected if DevTools is open. Chrome provides the "Disable Cache" option for forcing new requests

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda