When someone returns to a site, their browser can reuse files that are still current. An unchanged image or font may already be saved on their device, but they still need the latest correction to an article. The site therefore needs rules for when to reuse a saved file and when to retrieve an updated copy. Caching means saving something for reuse, so the system needs a way to check whether the saved copy is still valid and recognize when it has changed. If the system assumes saved copies remain current forever, readers may see old information. If it discards every saved copy, the browser must download the same material on every visit. The people responsible for the content, images, fonts, and other files should agree on how changes to each will reach readers.
Reuse what is unchanged and refresh what is different.
A returning reader does not need to download the same unchanged brand image on every page. Letting the browser retain it saves repeated work. When the image or stylesheet changes, its new version identifier tells the browser to download the updated file. If an article’s wording changes while its logo remains the same, the visitor should receive the corrected wording without needing a fresh copy of the unchanged logo. If a stylesheet changes how an interaction appears or responds, update its version identifier so the browser retrieves it. The browser can then retrieve the changed file while continuing to use other saved files that remain current.
Decide what to reuse according to whether the saved material is still current. An article correction must reach readers; an unchanged font need not be delivered repeatedly. The site can give readers current information while saving them the time and data needed to download unchanged files again. When caching works well, readers can use the site without thinking about which copies it has saved. It should not require them to know how to force a refresh in order to see an ordinary content correction.
Put it into practice.
Identify files with fixed versions, such as images and stylesheets, separately from article text that editors can change on its own. When a file changes, give its link a new version identifier so the browser requests the updated file. Use the application’s existing revision checks to stop it serving an older saved article after an editor corrects the text. Check a returning visit as well as a first visit. Reuse material that is still correct and retrieve changed information so returning readers see the current message.
What can stay, and what must a returning visitor see anew?