feat(api): add Redis caching for user quota and improve cache invalidation
Add 1-min TTL caching to CheckQuotaHandler (previously uncached, hitting 3 DB queries per guarded request). Add cache invalidation to MeterUsageHandler and UpgradeSubscriptionHandler so quota caches stay fresh after usage metering and plan changes. Increase search results TTL from 1min to 2min per spec. Add market cache invalidation on listing creation to keep district stats and market reports consistent. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -63,7 +63,7 @@ describe('GeoSearchHandler', () => {
|
||||
expect(mockCache.getOrSet).toHaveBeenCalledWith(
|
||||
expect.stringContaining('cache:geo_search:'),
|
||||
expect.any(Function),
|
||||
60,
|
||||
120,
|
||||
'geo_search',
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user