High amount of Cache Write

We currently have a NextJS App Router 14.2.5 website hosted on Vercel.

We are a high traffic website but we only have ~100 revalidation/day. We make a heavy use of tags in order to have a granular control, and since we use a lot of resources for rendering one page, we wouldn’t want to revalidate the whole page since it would most likely flood our backend servers with queries.

Those ~100 revalidation/day generates ~9K page views with MISS/STALE/REVALIDATED edge status code. My resources weight around 20kb. Those ~100 revalidations should then trigger ~100 data writes, since I have one unique tag per fetched resource, and ~100 resources revalidated. Then it should be around 100*20kb, so ~2mb of write or around 250 write units (=8kb).

What I cannot understand, is why I am more close to 700K write units, or around ~4gb/day.
If I take one of the highest usage request : mybackend.com/wp-json/wp/v2/dossiers/53160, it has 10007 requests in the last 7 days. The route itself returns a 10,8kb response (with gzip enabled. 33.4KB response without), and has a data cache hit rate of 98.8%. I expect that only the remaining 1.2% should generate cache writes, that would be 180 requests. so I should have 180 * 10.8kb of write more or less, but what I actually find in the usage is 187,41 MB.

Is there a mistake in the interpretation of those datas ? If not, how can I have a deeper understanding of this issue ?

Also, a related remark : when reviewing manually the logs for MISS/STALE/REVALIDATED requests, whenever I see a Cache Hit subrequest, it is impossible to find one with more than 10s age. How can that be since I only use cache tags and when I see the cache SET, the expire is set to 1 year.

Hey @f7b5!

Have you already read the documentation about how to manage and optimize usage for Data Cache? That has some info about what what counts toward usage and how changes to your app can affect that metric.

You can get more details about which projects and paths are using the most by checking the Data Cache section of the Usage tab on your team’s dashboard.

If neither of those resources get you the info you need, please let me know so I can help get you the resources you need.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.