YouTip LogoYouTip

Att Html Manifest

# HTML `manifest` Attribute The `manifest` attribute of the `` tag is used to specify the location of the document's cache manifest. This manifest file is a simple text file that lists the resources (such as HTML pages, CSS stylesheets, JavaScript files, and images) that the browser should cache for offline access. --- ## Introduction to Application Cache Introduced in HTML5, the **Application Cache (AppCache)** allows web applications to be cached locally, enabling users to access them even without an active internet connection. Using the `manifest` attribute provides three primary advantages: 1. **Offline Browsing:** Users can navigate and use the web application when they are offline. 2. **Speed:** Cached resources load significantly faster because they are retrieved directly from the local disk rather than over the network. 3. **Reduced Server Load:** The browser only downloads updated or modified resources from the server, reducing bandwidth consumption and server strain. > **Note:** The `manifest` attribute should be included on every page of your web application that you want the browser to cache. --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | `URL` | The address of the cache manifest file.

**Possible values:**
β€’ **Absolute URL:** Points to another website (e.g., `manifest="https://www.example.com/demo.appcache"`)
β€’ **Relative URL:** Points to a file within the same website (e.g., `manifest="demo.appcache"`) | --- ## Code Example Below is an example of an HTML document that references an external cache manifest file (`demo.appcache`) for offline browsing: ```html Offline-Enabled Document Title

Offline Web Application

The content of this document can be viewed even when you are offline.

``` ### Structure of a Manifest File (`demo.appcache`) A typical manifest file is a plain text file saved with the `.appcache` extension (historically served with the MIME type `text/cache-manifest`). Here is a basic example: ```text CACHE MANIFEST # Version 1.0 CACHE: # Resources to cache index.html styles.css logo.png script.js NETWORK: # Resources that require the user to be online login.php FALLBACK: # Fallback page if a resource is unavailable offline / /offline.html ``` --- ## Browser Support The `manifest` attribute is supported by major legacy and modern desktop browsers: * Google Chrome * Mozilla Firefox * Safari * Opera * Internet Explorer 10 (Internet Explorer 9 and earlier versions do **not** support this attribute) --- ## Important Considerations & Modern Alternatives While the `manifest` attribute and HTML5 Application Cache were widely adopted in the past, they have been deprecated in modern web standards. * **Deprecation Warning:** The HTML5 Application Cache feature is now deprecated and has been removed from the web standards. * **Modern Alternative:** For modern web applications requiring offline capabilities, background syncing, and advanced caching strategies, it is highly recommended to use **Service Workers** and the **Cache API** (often implemented via Progressive Web Apps, or PWAs) instead of the `manifest` attribute.
← Att Html XmlnsAtt Hr Width β†’