This demo of
Archivium cache unbust is re-deployed on a cron job on the 3rd of every month, with:
- UNBUST_CACHE_SUPPORT=1 90 365
- UNBUST_CACHE_TIME=600 86400 2592000
Explanation
- Every month, the major version of the stylesheet is incremented, and a versioned styles.v[$version].css file is generated which is referenced in index.html. The background color is changed with every version.
- index.html uses style version v1 this release, ie. styles.v1.css
- The IFRAMEs below show the list of files generated by build.sh and filled by unbust.sh respectively.
- A cache policy is implemented in cache-policy.sh. Based on the above parameters the cache schedule was calculated.
- The versioned assets are served with Cache-Control: public, max-age=63072000, immutable, stale-while-revalidate=2592000, stale-if-error=31536000
- The unversioned entry point index.html's cache duration is set according to policy (currently Cache-Control: public, max-age=600, stale-if-error=31536000)
- The checkmark SVG is cached at the CDN edge for 1 minute, and in-browser for 5 minutes. All other assets are only browser-cached.
- This is an offline demo - turn on airplane mode to see the offline features. You can still navigate to offline content after turning the network off.
The demo is deployed on the following CDNs: