Ask Your Question
3

What could be the reason for 304 modified and cache miss on the NextJS Vercel site?

asked 2023-05-29 22:04:11 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-29 22:17:02 +0000

lakamha gravatar image

A 304 response code indicates that the resource has not been modified since the last time it was accessed, and the client's cache already has a copy of it. A cache miss indicates that the requested resource is not present in the cache and needs to be retrieved from the server.

There could be several reasons for a 304 modified and cache miss on a NextJS Vercel site. Here are some possible explanations:

  1. The browser or CDN cache might be configured to check if the resource has been modified since it was last accessed. If the resource has not changed, a 304 modified response would be returned, indicating that the existing cached version is still valid.

  2. If the resource has not been accessed recently, it may have been evicted from the cache. When a user requests the resource again, a cache miss would occur, and the resource would need to be retrieved from the server.

  3. The caching headers on the resource may be set to allow for longer cache times, which could result in more cache hits and fewer cache misses.

  4. The resource may be cached at different levels, such as the browser, CDN, and server. If the caching behavior is not properly configured across all levels, it could result in cache misses and 304 responses.

To further diagnose the issue, it may be helpful to inspect the caching headers on the resource and investigate the caching behavior at each level.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-29 22:04:11 +0000

Seen: 11 times

Last updated: May 29 '23