building-envelope-data / database

Reference implementation of a product data server as part of the product data network buildingenvelopedata.org
MIT License
0 stars 0 forks source link

Invalidate cached resource when it was updated #34

Open christoph-maurer opened 1 year ago

christoph-maurer commented 1 year ago

When I upload a new file for an existing resource and then I click on the locator link in the column Resource Tree Root, I download the old file. After clicking in Chrome on Inspect, the locator link downloads the new file. I don't know whether there is an easy solution. When I don't use the locator link but enter the URL of the locator manually, I can download the new file.

simon-wacker commented 1 year ago

The reason is that you browser has cached the old version, believes that it is sufficiently recent and delivers that version instead of asking the server if there is a new one. Caching is turned off when the inspector is open. I can fine tune the cache meta information given to the browser when it requests a resource to somewhat avoid this behavior. In general, caching is a feature that makes thinks faster by avoiding unnecessary server round trips when information is sufficiently recent; what sufficiently recent means can be fine tuned by the web developer and depends on the context.