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

165
Visualizações
Browser Downloading Last GET Request Instead of Reloading

I'm mildly new to front end and back end development but I need help with a weird browser problem.

I have made a website but whenever I close out of its tab then do "CTRL-SHFT-T" (open last tab), the browser downloads the last GET request instead of loading a page.

I already know how to use history.pushState() and the popstate event listener, so I don't believe either of those are the problems, but I recognize they could be.

This is a big problem because my website is set up with an index.html file that is just the head, header, and footer, then every time the user navigates to another page, it sends a GET request for its respective HTML file an populates it in between the header and footer. (It stores the html in a js object once the GET request is fulfilled so then if the user navigates back to the same page, it's already stored so it doesn't need to request again)

I have done a little research on it there are very few people who have experienced this problem and it seems to have something to do with the "Cache-Control" headers. I don't believe I had this problem until I used helmet(), although I am unsure because when I turn it off it still happens. Should I manually set every CSP and not use helmet, should I use it and seek a solution by changing these headers, or am I way off track and am deep in the XY Problem?

My website's server is run on express.js and hosted on heroku.

about 4 years ago · Juan Pablo Isaza
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