Skip to content

Fallback image should respect Cache-Control headers #563

@nicolasbuch

Description

@nicolasbuch

Is your feature request related to a problem? Please describe.
We are processing PDF files, converting them to images before serving them through the SIH.

This process usually takes a few seconds and in rare cases a user can request an image that has not yet been processed and therefore does not exist. Here we return a default image through the DEFAULT_FALLBACK_IMAGE functionality which works well.

The problem is that the image is available a few seconds after the user originally requested it. If the user requests the image again, after it is available, the 404 response that he got the first time is cached. This seems to be because the cache control header is hardcoded to max-age=31536000.

Describe the feature you'd like
The DEFAULT_FALLBACK_IMAGE should respect the Cache-Control headers set on the fallback image instead of being hardcoded to max-age=31536000. I can see that this is the case when serving images that do not fallback as seen here.

I think that a similar implementation would solve the problem

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions