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
I'm using next-boost with redis cache adapter. It appears that 504 can easily be produced in uncached pages that have getServerSideProps taking more than 1 sec (this probably doesn't matter but for me getServerSideProps can take 5 seconds easily).
Using next-boost request handler in a standard way
// nextRequestHandlerMiddleware.jsconstCachedHandler=require("@next-boost/next-boost").default;constgetNextRequestHandler=async(dev)=>{constargs={ dev };lethandler;if(dev){constinit=require("./init").default;handler=awaitinit(args);}else{constscript=require.resolve("./init");constcached=awaitCachedHandler({
script,
args,},{quiet: true,},);handler=cached.handler;}returnhandler;};module.exports=getNextRequestHandler;
# initial request is sent to the page without existing cache and aborted before a response is given with ctrl+c
curl "https://myapp/en/page-without-cache" -v
# new request is sent right after aborting previous request, response is waited and will have status 504
curl "https://myapp/en/page-without-cache" -v
# final request is sent after 504, response to this will be 200 as the page will be cached at this point
curl "https://myapp/en/page-without-cache" -v
The text was updated successfully, but these errors were encountered:
Might have been the same case as "'get /slow-10100'" test, however I discovered that it would be best to have this library cache 308 nextjs redirects (return { redirect: { permanent: true, destination: url }). I included status code (in case of 200 or 308 from render result) in cached data in my fork and it got better.
I'm using next-boost with redis cache adapter. It appears that 504 can easily be produced in uncached pages that have getServerSideProps taking more than 1 sec (this probably doesn't matter but for me getServerSideProps can take 5 seconds easily).
Using next-boost request handler in a standard way
How to reproduce:
The text was updated successfully, but these errors were encountered: