Next.js Discord

Discord Forum

Is it possible to cache dynamic images

Unanswered
AM posted this in #help-forum
Open in Discord
AMOP
Fetching multiple posts, each with its own image, and all of the images are loaded successfully. However, an issue arises when navigating from page #1 to page #2 and then returning. The images from page #1 that were fetched previously are being refetched again. Is it possible to prevent this behavior, as they have already been loaded and should not need to be fetched again?

2 Replies

It's not an expected behavior, because modern browsers will re-use the cache whenever possible

For example, this is what happens when I navigating between my blogs and a blog post
You can see, the disk cache is being re-used
So check if you have disabled the cache, or any other reasons cause your images are not cached