I am delivering some images through a web service.
Here below the scenario with a dummy resource example:
I have 2-minute cache in the Akamai edges and downstream cache.
My clients download my resource
/api/myimage and, when the Akamai cache expires, they perform an HTTP request with the ETag header.
My API returns
- a 304 if the resource is not been changed
- a 200 with the new resource if it’s changed
Now I am improving the service returning the
In this step the Akamai and downstream cache is still at 2 minute.
I change the Akamai caching value to 1day keeping the downstream cache to 2 minute.
I change the resource
/api/myimage and I send an invalidation request with the given tag.
What is the expected behavior?
I believe it depends on the edge caching state.
If the edge has stored in the cache the resource without the
Edge-Cache-Tag header and it has continually revalidated it, the edge has no knowledge of the Cache-Tag I set.
If the edge has stored the original resources without the
Edge-Cache-Tags and then, for some reason, it has removed it from the cache and then requested it again with the
Edge-Cache-Tag, when I call the API I will purge it from the cache.
Could you please confirm the behavior or explain to me what should happen in the above scenario?
Looking at the edge header behavior I see that if I change a header in the 304 response it will not change the cached value.
All the best