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

382
Visualizações
Flask - Javascript file requires multiple page refresh to load net::ERR_INVALID_HTTP_RESPONSE 200

I have a Flask app that relies on javascript for certain functionality. The javascript file loads fine sometimes and other times I get an error in the console:

GET http://localhost:5000/static/js/sm4sb.js net::ERR_INVALID_HTTP_RESPONSE 200

When this happens the javascript is not loaded. I then have to refresh the page multiple times until the console does not show this error.

I read somewhere that putting this in my config.py file should fix it, but it doesn't

SEND_FILE_MAX_AGE_DEFAULT = 0

Elsewhere someone suggested adding this:

@app.after_request
def add_header(response):
    response.headers['Cache-Control'] = 'no-cache, no-store'

But when I do that I get an error

AttributeError
AttributeError: 'NoneType' object has no attribute 'vary'

Note that the issue is with Vivaldi (Chrome) but does not seem to be an issue (so far) running in Firefox.

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