Skip to content

Releases: web-widget/shared-cache

v1.7.2

05 Aug 10:30
05455f6

Choose a tag to compare

Patch Changes

  • 1c29aaa: fix: Comprehensive fix for readonly headers modification issues

    This change completely resolves the readonly headers modification problems that were partially addressed in the previous fix. The solution includes:

    New Features:

    • Added src/utils/response.ts with intelligent response utilities:
      • modifyResponseHeaders(): Smart header modification with readonly fallback
      • setResponseHeader(): Convenient single header setting function

    Bug Fixes:

    • Fixed setCacheStatus() function in fetch.ts to properly handle readonly headers
    • Optimized createInterceptor() function to avoid unnecessary Response cloning
    • Ensured cache.ts uses safe header modification patterns
    • All header modifications now gracefully handle readonly scenarios

    Performance Improvements:

    • No Response cloning when no header overrides are configured
    • Direct header modification when possible (for mutable headers)
    • Smart fallback to new Response creation only when necessary
    • Significant performance improvement for common use cases

    Testing:

    • Added comprehensive unit tests for response utilities (10 new tests)
    • Added specific tests for createInterceptor readonly headers handling (6 new tests)
    • All 258 tests pass with 93.93% code coverage
    • Tests cover edge cases, error scenarios, and performance considerations

    This fix ensures that header modifications work reliably across all environments (browser, Node.js, etc.) while maintaining optimal performance by avoiding unnecessary object creation.

v1.7.1

05 Aug 03:39
6b4c604

Choose a tag to compare

Patch Changes

  • b309ee1: fix: Fix Response headers modification bug in createInterceptor function

    The createInterceptor function was attempting to directly modify the Response.headers object, which is read-only in both browser and Node.js environments. This caused the cacheControlOverride and varyOverride options to not work properly.

    Changes made:

    • Create a new Headers object from the original response headers
    • Apply header modifications to the new Headers object
    • Create a new Response object with the modified headers
    • Return the new Response for successful responses

    This fix ensures that cacheControlOverride and varyOverride work correctly for successful responses while maintaining backward compatibility.

v1.7.0

30 Jun 08:40
517b262

Choose a tag to compare

Minor Changes

  • 674dbd1: Replace waitUntil with event field for ExtendableEvent support.

v1.6.0

21 Jun 07:55
1338efd

Choose a tag to compare

Minor Changes

v1.5.0

20 Jun 07:07
52bccd1

Choose a tag to compare

Minor Changes

  • 4520827: Enhanced logging system with structured output and multiple log levels.

v1.4.0

20 Jun 04:53
0ff3977

Choose a tag to compare

Minor Changes

  • 1d9e185: Remove dependency - @web-widget/helpers.

v1.3.0

08 Jun 16:15
7611598

Choose a tag to compare

Minor Changes

  • 8d2ad75: new createFetch interface.

v1.2.0

08 Jun 15:53
8d2ad75

Choose a tag to compare

Minor Changes

v1.1.0

19 Oct 10:49
1d1d5fe

Choose a tag to compare

Minor Changes

  • 5ea20fb: The waitUntil option can be used to extend the life of background tasks.

v1.0.0

23 Sep 03:02
9cd10bd

Choose a tag to compare

Major Changes

  • 0adbc60: Reduce the deviation from the mainstream edge worker environment's Cache API implementation.
  • 8682fd6: - Support ignoreMethod option.
    • Support ignoreRequestCacheControl option.
    • Ignore spaces in cache keys.

Minor Changes

  • 80b5a4b: Added ignoreVary option.

Patch Changes

  • 98bdedb: - The stale-while-revalidate and stale-if-error directives are not supported when using the cache.put or cache.match methods.
    • Support HEAD requests.
  • b3761de: Fix Request.cache equal to "default" will cause exception.