feat(cache): Implement Redis Caching Layer for Listings Performance Optimization#364
Open
Emrys02 wants to merge 6 commits intoOgstevyn:mainfrom
Open
feat(cache): Implement Redis Caching Layer for Listings Performance Optimization#364Emrys02 wants to merge 6 commits intoOgstevyn:mainfrom
Emrys02 wants to merge 6 commits intoOgstevyn:mainfrom
Conversation
|
@Emrys02 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Overview
Implement a centralized Redis caching layer for PayEasy listings using Upstash.
Important
Implementation Status: This PR establishes the core Infrastructure and Caching Wrapper logic. The API routes currently use temporary placeholder callbacks for the data source. These must be replaced with real backend logic (DB/Blockchain) in a subsequent PR.
Technical Improvements
lib/redis.tsand unified listing data structures inlib/types.ts.lib/listings.tsas an intelligent caching wrapper:/api/listingsand/api/listings/[id]with built-inCache-Controlheaders for both server and browser-side caching..env.examplewith standard project credentials including Redis, MongoDB, JWT, and Stellar network settings.Key Caching Details
listings:all:page:${page}andlistings:detail:${id}.Cache-Control: public, max-age=900(List) /max-age=3600(Detail).Verification
.env.local./api/listingsor/api/listings/1once (Cache Miss) and twice (Cache Hit).[Cache Hit]and[Cache Invalidation]events.Closes #32