HTML5
What is the Application Cache in HTML5?
The Application Cache (AppCache) was an early HTML5 feature that let websites work offline by caching files listed in a manifest. However, AppCache is deprecated and removed from modern browsers. Today you should use Service Workers with the Cache API for offline support.
AppCache is DEPRECATED and has been removed from modern browsers. Do NOT use it in new projects. This topic is included for historical context only.
What Was the Application Cache?
AppCache allowed a web application to declare, in a manifest file, which resources (HTML, CSS, JS, images) the browser should cache. Once cached, the app could load and run even without a network connection, enabling early offline web apps.
<!-- OBSOLETE: do not use in new code -->
<html manifest="app.appcache">
<!-- app.appcache -->
CACHE MANIFEST
/index.html
/styles.css
/app.jsWhy It Was Deprecated
- Confusing and error-prone caching rules (e.g., pages served from cache even when updated).
- Poor control over cache updates and network requests.
- It was replaced by a far more flexible and powerful mechanism.
The Modern Replacement: Service Workers
Service Workers are scriptable network proxies that give you full, programmatic control over caching and offline behaviour, using the Cache API. They are the standard way to build offline-capable Progressive Web Apps (PWAs).
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js")
.then(() => console.log("Service Worker registered"))
.catch((err) => console.error("Registration failed:", err));
}For offline support today, learn Service Workers and the Cache API. AppCache should be treated as removed technology.
