Http Cache
Expires
old one, check the client time. So if user modify client-side time, it would be invalid.
Cache-control
common pattern E.g max-age:86400
no-store
Not store any cache data in browser
max-age
Refetch data after XX second
no-cache(max-age=0)
Have cache in client, but still ask server every time
Last-Modified, If-Modified-Since
Use for server for identifying the data is changed or not by modified time
Etag, If-None-Match
Common pattern, use for server for identifying the data is changed or not by hash code (like md5)
How to force update cache
- Use hashcode in filename. E.g webpack.common.1eg3pa.js
- Add extra params in request's url E.g xxxx.jpg?120394