Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
Cache Busting Options for Javascript

I know there are a few posts on this around on cache busting but I was wondering if I could get a bit of help with summarizing options for cache busting, see if I've missed any. It is a significant issue with the enterprise webapp I maintain and customize as a Web Dev / Sys Admin.

From what I have seen, the most reliable is to create different versions of the file for each change, based on a time stamp or similar. File versioning has been used in the past by other admins prior to my time, at a basic level (something1.js, something2.js). Problem is we don't have a good method in place for this and the application itself has a lot of dependencies between pages from years of customization.

Recently, I tried adding a simple script that adds a cache-control Meta tag in the header to try to force reload of the files if older than 1 week. Here is my very rudimentary attempt at it.

let headForCacheControl = document.querySelector("head");
let cacheControl = document.createElement('meta');
cacheControl.setAttribute('http-equiv','cache-control');
cacheControl.setAttribute('content','must-revalidate max-age=604800');
headForCacheControl.appendChild(cacheControl);

Any feedback on this approach, any other options beyond these two, or advice on implementing file versioning is very welcome.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda