News for hackers. Stuff that matters.
Re:The Baseline Costs of JavaScript Frameworks by paraditedc on Wednesday November 28, 2018 @01:04PM (#18553920)
Curious what's the strategy you use to invalidate browser cache for non-SPA? When deploying new changes.
Re:The Baseline Costs of JavaScript Frameworks by adamcw on Wednesday November 28, 2018 @01:36PM (#18554248)
SPA's tend to come with build systems, but that is just a side effect of their complexity. You can have a front-end build system independent of SPA/MPA architecture. In fact, you should, at least for minification and whatnot. That system can add a content hash or some other strategy to force invalidation at build time for deployed artifacts. Barring that, whatever is serving the asset should handle it's caching/TTL stuff correctly, but config of that can be hard (in complexity or domain knowledge.) Build hashes have been the most resilient approach that I've found so far. Mostly because it is easily automated in artifact generation.
Re:The Baseline Costs of JavaScript Frameworks by pritambaral on Wednesday November 28, 2018 @01:41PM (#18554309)
Versioned URLs of everything except index.html should work just fine.
Re:The Baseline Costs of JavaScript Frameworks by astockwell on Wednesday November 28, 2018 @02:30PM (#18554811)
As others have mentioned: app.min.js?$hash-or-date-or-releasever$
Re:The Baseline Costs of JavaScript Frameworks by gondo on Wednesday November 28, 2018 @02:09PM (#18554614)
versioned url
Re:The Baseline Costs of JavaScript Frameworks by paraditedc on Wednesday November 28, 2018 @10:17PM (#18557762)
Sorry if it is not clear, I was referring to html files returned by servers when user visits old-fashioned server-rendered web pages (non-SPA pages) like `/page1` or `/page2`.

How do you version urls like those?

Something like `/page1?t=201811292359`? That seems ugly to the users.

Re:The Baseline Costs of JavaScript Frameworks by gondo on Thursday November 29, 2018 @05:15AM (#18559211)
rules i use:

- content under certain url should never change

- if it has to change then use ESI or/and smaller cache expiration times

- if it has to change very often/realtime, then use static html as skeleton and load only required information via javascript. f.e.: info about currently signed in user, eshop basket