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

Rework context to actually share memory cache between middleware and handlers for all requests #2358

Merged
merged 5 commits into from
Jun 25, 2024

Conversation

jpreynat
Copy link
Member

@jpreynat jpreynat commented Jun 24, 2024

This PR renames the existing getGlobalContext to getRequestContext, since the getOptionalRequestContext().cf object actually is in Cloudflare, and creates an actual getGlobalContext method, that returns getOptionalRequestContext().ctx and that can be used across all executions.

This PR then uses the new getGlobalContext method to create the local memory cache globally and use it across all requests and between the middleware and requests handlers.

@jpreynat jpreynat self-assigned this Jun 24, 2024
Copy link

argos-ci bot commented Jun 24, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 2 changed Jun 25, 2024, 12:24 PM

@jpreynat jpreynat merged commit db45c6d into main Jun 25, 2024
13 of 15 checks passed
@jpreynat jpreynat deleted the improve-memory-cache branch June 25, 2024 12:30
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