diff --git a/changelog.md b/changelog.md index f7fc751..a2f49fd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2025-02-07 - 3.0.68 - fix(cache-manager) +Simplify cache control headers in cache manager + +- Removed unnecessary cache control headers while setting modern Cache-Control. + ## 2025-02-06 - 3.0.67 - fix(serviceworker) Enhance header security for cached resources in service worker diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index fe3e945..8c15f29 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@api.global/typedserver', - version: '3.0.67', + version: '3.0.68', description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.' } diff --git a/ts_web_serviceworker/classes.cachemanager.ts b/ts_web_serviceworker/classes.cachemanager.ts index 9cc1bcf..8419028 100644 --- a/ts_web_serviceworker/classes.cachemanager.ts +++ b/ts_web_serviceworker/classes.cachemanager.ts @@ -184,11 +184,8 @@ export class CacheManager { headers.set('Cross-Origin-Resource-Policy', 'cross-origin'); } - // Prevent browser caching while allowing ServiceWorker caching. + // Set caching headers - use modern Cache-Control only headers.set('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate'); - headers.set('Pragma', 'no-cache'); - headers.set('Expires', '0'); - headers.set('Surrogate-Control', 'no-store'); // IMPORTANT: Read the full response body as a blob to avoid issues (e.g., Safari locked streams). const bodyBlob = await responseToPutToCache.blob();