I have a resource that is served with Cache-Control: public, immutable
, ie I expect the resource to exist in the browser's cache for non-first time visitors.
(Browser support for "immutable" configuration is off-topic.)
How to check if a particular resource (eg image) is cached by the browser without triggering browser to load the resource?
I don't know if there is a way to do this from within code. But if you just want to check if a resource is loaded from cache you can check developer tools like @Yani suggested in comments.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.