What are the complete set of factors that affect image caching in web browsers? How much control does a web developer have over this, and how much is browser settings? Are there different considerations for other types of assets (i.e. scripts, audio)?
Thanks
The complete set of factors:
Web developers have very little control, but this is fine. Remember that caching is done for the benefit of the end user, usually to reduce page load time, and it’s generally infeasible for you to know all the considerations specific to every user.
The bit you can control is expiration time and no-cache behavior. These respectively specify that the user wants to refetch the resource because it is expected to have changed or should not be cached for other reasons.
Browsers may treat images differently than other resources (mainly differing in default expiration time when unspecified), but you can send HTTP headers for any resource.