I have a small http server which generates some images on-the-fly, and the generation process may take some time. After generation, the image is cached indefinetly.
Currently, if a user requests an image which is not cached, the server returns a 202 Accepted
with a Refresh
header. If the image is cached, a 301 Permanently Moved
is sent and the user redirected to a unique url (different images may share the same unique url).
The whole system breaks if the image is referenced in an <img>
tag (on Firefox, at least). Can this be solved without Javascript? If not, how would the script look like?