javascript - Fetch API Cache Mode -


according spec, there various cache modes fetch api. ("default", "no-store", "reload", "no-cache", "force-cache", , "only-if-cached") however, isn't clear each mode for, or state of browser support.

you can see documentation of polyfill here: https://fetch.spec.whatwg.org/

it explain each value means

"default" fetch inspect http cache on way network. if there fresh response used. if there stale response conditional request created, , normal request otherwise. updates http cache response. [http]

"no-store" fetch behaves if there no http cache @ all.

"reload" fetch behaves if there no http cache on way network. ergo, creates normal request , updates http cache response.

"no-cache" fetch creates conditional request if there response in http cache , normal request otherwise. updates http cache response.

"force-cache" fetch uses response in http cache matching request, not paying attention staleness. if there no response, creates normal request updates http cache response.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -