Mobile Web

HTML5 Application caches

This feature is supported in mobile applications only.

HTML5 application caches can be used to store and utilize resources needed in Web applications, such as HTML, CSS, and JavaScript files, and images.

You can cache certain files in the browser to use them in an offline state, or define them to be always updated from the server.

HTML5 application caches provide you with the following benefits:

  • Offline support

    If a cache file is downloaded after connecting to a site, the application can be used in an offline state.

  • Speed

    The cached files are saved in local storage, making cached resources load faster.

  • Reduced server load

    The browser only downloads content from the server when the cached files need to be updated, reducing server load.

The main application cache features include:

  • Cache activation

    The cache manifest file is used to activate the application cache and display cache information in the browser as simple text.

    To enable application caches, include the manifest attribute in the <html> tag on every page of your Web application that you want cached. The following code snippet demonstrates how to do this. For a complete source code, see appcache_update.html.

    <!DOCTYPE html>
    <html manifest="tizen.appcache">
       <!--Page content-->
    </html>
    

    The recommended file extension for the manifest file is .appcache. The file must be served using the text/cache-manifest MIME type.

  • Cache updating

    To update a cached item in the client, you need to change the manifest file.

    The browser checks only the edited items in the manifest, and checks whether cache update is needed. If the relevant page is updated from the server, manifest is applied as the basis even after edited items have been applied. If the update content is an addition or deletion of the defined file within the manifest, the manifest file can be edited.

    However, if the content in the defined file is changed, the cache is not updated. In that case, if the description or version is changed in the manifest, the browser can update the cache.

  • Cache management

    Application cache can control JavaScript based on events. It can check or update the current cache status.

Go to top