Using cache handler with pages file which uses getServersideProps #65661
Replies: 2 comments 7 replies
-
You may need to configuration-caching |
Beta Was this translation helpful? Give feedback.
-
I dug a bit more into the nextjs caching and took a look at the following. It is pretty clear to me that when dynamic rendering (using getServerSideProps) is involved there is no built in caching mechanism and none of the above caching mechanism can be used as well. The solution that I have finally decided to go with is to have a simple expressjs application above our main app which acts a proxy as well as takes care of caching the rendered HTML returned by the main app. |
Beta Was this translation helpful? Give feedback.
-
Summary
Is it possible to use the cache handler to cache the content of a pages file rendered using get server side props. Our application involves rendering pages where the content may vary by URL. We do use CDN to ensure the load on the server is minimal. Before moving to the folder driven architecture of nextjs we had implemented a custom express server where we use to get the rendered HTML using renderToHTML and cache the HTML in redis. With the new folder driven approach, is there a way to do this withiout having to revert to use a custom express server.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions