Skip to content

Conversation

EmrysMyrddin
Copy link
Collaborator

Description

Reduce response caching overhead when a operation is not cached.

  • The result is not clone, it is mutated in place to remove response caching additional fields
  • Do not collect entities when invalidation is disabled
  • Happy fast path to calculate TTL when it doesn't depends on an Interface or Union type field
  • Defer TTL/caching of response

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take
action on it as appropriate

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can
reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Environment:

  • OS:
  • @envelop/...:
  • NodeJS:

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose
the solution you did and what alternatives you considered, etc...

Copy link
Contributor

github-actions bot commented Oct 3, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@envelop/response-cache 8.2.0-alpha-20251003143108-b56597767a1f741fbd6420f60af9abdf439fd4b8 npm ↗︎ unpkg ↗︎
@envelop/response-cache-cloudflare-kv 6.0.0-alpha-20251003143108-b56597767a1f741fbd6420f60af9abdf439fd4b8 npm ↗︎ unpkg ↗︎
@envelop/statsd 7.0.1-alpha-20251003143108-b56597767a1f741fbd6420f60af9abdf439fd4b8 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Oct 3, 2025

💻 Website Preview

The latest changes are available as preview in: https://9130bbdf.envelop.pages.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant