-
Notifications
You must be signed in to change notification settings - Fork 0
Invalidation strategy #1
Copy link
Copy link
Open
Description
We need a way for the server to tell what has been cached on the client, and not just whether something is cached.
Currently, if you update the CSS for your site, there's no easy way to make sure your visitors' InlineCacher localStorage is cleared. We need to know when to call InlineCacher.reset() and send the latest inline styles.
There are a few approaches we could take:
- Setting the cookie value as an expiration date on the cache (e.g.
inline-cacher="1559076458")and invalidating if too old. - Setting the cookie value as a hash of the cached CSS (e.g.
inline-cacher="abc123def456") and invalidating if different to what's on the server. - Setting a data attribute on the style tag (
<style data-version="v1.2.3>) and setting the cookie value to this (e.g.inline-cacher="v1.2.3"), invalidating if too old.
I'm keen to get this right from the beginning to avoid setting up any technical debt.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels