It seems that the headers of network responses are discarded, and when a response is built from the cache it uses the request headers instead.
In my use case the response headers for a certain request contain crucial link information for paginated data. For example, I make a request to an API that returns 100 items in the first 'page', and the headers contain a link to the next 'page' that also returns 100 items and also has link headers for the subsequent page, and so forth. However, if the response is a cached response then these headers will be missing, which means that I cannot access more than a single page of data even if the subsequent pages have been previously cached.
Preserving the original headers and restoring them in the cached response would solve this issue.
It seems that the headers of network responses are discarded, and when a response is built from the cache it uses the request headers instead.
In my use case the response headers for a certain request contain crucial link information for paginated data. For example, I make a request to an API that returns 100 items in the first 'page', and the headers contain a link to the next 'page' that also returns 100 items and also has link headers for the subsequent page, and so forth. However, if the response is a cached response then these headers will be missing, which means that I cannot access more than a single page of data even if the subsequent pages have been previously cached.
Preserving the original headers and restoring them in the cached response would solve this issue.