We have a RESTful web service with a URI pattern like:
- /orders/
- /orders/1
- /orders/1/changelog
We’re using proper HATEOS to link to link from the /orders/1 resource to its changelog found at /orders/1/changelog. When we are making a change to the /orders/1 resource, we do that by sending PATCH request to the resource.
Any cache of /orders/1 will be invalidated by the PATCH, but the same is not true of the /orders/1/changelog resource.
Is there any way via HTTP Headers or other mechanism to invalidate any caches of a different resource after a PATCH? The service integrates with a legacy system for the data so there’s no easy way to use ETags or If-Modified-Since to have the service check if the resource is invalid or not is not really feasible, so I was hoping to have response headers do the cache invalidation for me.
Am I totally off base? Other options?
This https://datatracker.ietf.org/doc/html/draft-nottingham-linked-cache-inv-00 spec discusses how it could be done using link headers.