You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works great. Thanks!
But I am somewhat worried about that SSR Middleware's cache has no policy like TTL or size which QueryResponseCache has. And I want to unify them.
Can I populate cache into relay environment directly?
The text was updated successfully, but these errors were encountered:
dehypnosis
changed the title
Cannot populate ssr cache into the QueryResponseCache, not the ssrMiddleware's cache map?
Can I populate SSR cache into the QueryResponseCache directly?
May 23, 2018
I just make simple onInit hook to your cacheMiddleware which implements SSR caching like below. Will it cause any unexpected problem?
where create relay network interface
// ... middlewarescacheMiddleware({size: 100,// max 100 requeststtl: 900000,// 15 minutes,onInit: cacheMap=>{// rehydrate cache from response script on browserif(IS_BROWSER){constcacheArray=window.__API_CACHE__;cacheArray.forEach(cacheItem=>{cacheMap._responses.set(cacheItem[0],cacheItem[1]);});}else{// export extract function for serverextractCache=()=>cacheMap._responses;}},}),// ...
This works great. Thanks!
But I am somewhat worried about that SSR Middleware's cache has no policy like TTL or size which QueryResponseCache has. And I want to unify them.
Can I populate cache into relay environment directly?
The text was updated successfully, but these errors were encountered: