Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add async set cache #559

Merged
merged 12 commits into from
Jun 11, 2024
Merged

feat: add async set cache #559

merged 12 commits into from
Jun 11, 2024

Conversation

vsseixaso
Copy link
Contributor

@vsseixaso vsseixaso commented Jun 3, 2024

What is the purpose of this pull request?

Enhance the HTTP client's cache middleware by adding an asynchronous option (asyncSet) for setting cache entries, improving performance by preventing blocking of the main execution flow.

What problem is this solving?

Addresses performance bottlenecks caused by synchronous cache writes, which can lead to delays with large responses or frequent requests. The asyncSet option allows asynchronous cache writes, reducing latency and improving responsiveness.

How should this be manually tested?

Setup:

  1. Run node-vtex-api with yarn link and yarn watch.
  2. Run a server that uses vtex/api (e.g. render-server) with the yarn link @vtex/api.

Configuration:

  1. Enable asyncSetCache in the HTTP client's settings.

Monitoring:

  1. Add the header: 'jaeger-debug-id': 'async_set_cache' to the request for a page.
  2. Check trace on Honeycomb

Screenshots or example usage

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

@vsseixaso vsseixaso self-assigned this Jun 3, 2024
@GusGuerra GusGuerra merged commit bfe0cae into master Jun 11, 2024
2 checks passed
@GusGuerra GusGuerra deleted the feat/add-async-set-cache branch June 11, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants