HTML manifest Attribute
The obsolete HTML manifest attribute was historically used on the <html> element to identify an Application Cache manifest containing resources that a browser could store for offline use.
manifest attribute and the Application Cache system are obsolete and should not be used in modern webpages. Modern web applications can use service workers when offline caching and programmable resource handling are required.
Historical Syntax
The manifest attribute was placed on the document's root <html> element and contained the URL of an Application Cache manifest file:
<!doctype html>
<html lang="en" manifest="example.appcache">
<head>
<meta charset="utf-8">
<title>Example Page</title>
</head>
<body>
...
</body>
</html>
The referenced manifest file told supporting browsers which resources belonged to the application's offline cache.
Historical Elements
The obsolete manifest attribute was associated with the root <html> element.
| Element | Historical Purpose |
|---|---|
<html> |
Specified the URL of an Application Cache manifest used to identify resources for offline caching. |
Historical Use
Application Cache, often called AppCache, was designed to let web applications continue working when a network connection was unavailable. A webpage associated itself with a cache manifest by placing the manifest attribute on its <html> element.
The cache manifest was a separate text resource that could identify files to cache and provide instructions for how certain network requests should be handled.
A simple historical cache manifest could look similar to this:
CACHE MANIFEST
CACHE:
index.html
styles.css
logo.png
NETWORK:
*
Supporting browsers could download the listed resources and store them locally. Later visits could use cached resources when the network was unavailable.
Why It Became Obsolete
Application Cache had behavior that was difficult for developers to control reliably. Cache updates and network handling could produce unexpected results, and the manifest-based system provided limited control over individual requests.
Service workers provide a more flexible approach. A service worker can respond to network requests through script and allows an application to define its own caching and offline strategies.
Modern Alternative
Do not replace manifest with another attribute on the <html> element. Remove the obsolete attribute. When an application needs offline resource caching, service workers provide the modern approach.
Historical HTML
<html lang="en" manifest="example.appcache">
Modern HTML
<html lang="en">
The obsolete attribute is simply removed from the document. If a service worker is needed, JavaScript can register a service worker file:
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/service-worker.js");
}
The service worker itself can listen for events and implement the caching strategy required by the application. This is different from the old AppCache system because the behavior is controlled programmatically rather than through an attribute and cache manifest file.
manifest attribute on <html> is not the same as a modern Web App Manifest. A Web App Manifest provides metadata about an installable web application and can be referenced with <link rel="manifest">. It does not replace the old Application Cache system.
Legacy Browser Support
The manifest attribute was implemented by browsers that supported the former Application Cache system.
Application Cache has been removed from modern web development practices and new webpages should not depend on the manifest attribute. Use current web platform features such as service workers when offline caching is required.
For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.
Related Attributes
Other attributes associated with the <html> element or older document-level HTML features include:
version- An obsolete attribute historically used to identify an HTML version.lang- A current global attribute commonly used on<html>to identify the human language of the document.
Specifications
The manifest attribute on the <html> element is obsolete. The HTML Living Standard directs authors to use service workers instead. See the WHATWG HTML Living Standard for information about obsolete and non-conforming features.
