feat(magento): add 30-minute in-memory cache for GET requests#519
Open
JonasJesus42 wants to merge 3 commits into
Open
feat(magento): add 30-minute in-memory cache for GET requests#519JonasJesus42 wants to merge 3 commits into
JonasJesus42 wants to merge 3 commits into
Conversation
…rm field Removes apiToken from the configSchema form and StateSchema — users now set their Magento integration token in the encrypted Token field of the HTTP connection. resolveCredentials reads MESH_REQUEST_CONTEXT.authorization (strips Bearer prefix) with MAGENTO_API_TOKEN env var as a local fallback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All magentoFetch GET calls are now cached for 30 minutes per store URL + path combination. Non-GET requests bypass the cache. Cache key is baseUrl|storeCode|url to ensure per-store isolation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The runtime exposes MESH_REQUEST_CONTEXT as RequestContext<TSchema, BindingRegistry> which has a raw `token` field (no Bearer prefix) instead of `authorization`. Update MeshRequestContext interface and resolveCredentials to use `token` directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server/lib/cache.ts) for Magento API responses.magentoFetchGET calls are cached for 30 minutes per store; non-GET requests bypass the cache entirely.baseUrl|storeCode|urlto ensure isolation between different stores running in the same process.DEBUG=truelogs HIT/MISS to console for easy diagnosis.🤖 Generated with Claude Code
Summary by cubic
Add a 30‑minute in-memory cache for Magento GET requests and switch auth to use the connection’s token (
MESH_REQUEST_CONTEXT.token) instead of anapiTokenstate field. This cuts API calls and simplifies setup per store.New Features
magentoFetchGET requests for 30 minutes per store using keybaseUrl|storeCode|url; non‑GET requests bypass cache.DEBUG=truelogs cache HIT/MISS.MESH_REQUEST_CONTEXT.token(raw token; we add the Bearer prefix);MAGENTO_API_TOKENremains a fallback.Migration
apiTokenfrom any stored state; it’s no longer in the config form or state schema.MAGENTO_API_TOKENin env.baseUrlis provided (still required).Written for commit 5a5e6d9. Summary will update on new commits.