Skip to content

Cache control for solution images

Hugo Kerstens requested to merge 509-solution-cache into master

Closes #509 (closed)

Implement simple cache control for solution images. This is done by sending the Last-Modified header as well as Cache-Control: no-cache to force re-validation by the client. When an image is cached by the client and it is requested again, it will send a If-Modified-Since header which is compared to the last modified time of the most recent image.

Without a page reload the images still do not update, since no new request is made by the browser. The only way around this that I can find is this unorthodox method: loading the image using the browser fetch api and converting it to a base64 string which will be inserted in the DOM.

I'm fine with leaving it like this, since the user will most likely try refreshing the page when old content is displayed. Also, this will most likely not affect many users.

Edited by Anton Akhmerov

Merge request reports