Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!