Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ HTML5 Application Cache     - Iptables small summary (Linux)

- The wrong in Linux: too many open files (Linux)

- Mutt - an email client that sends messages through the terminal (Linux)

- jQuery get value drop-down list and select text (Programming)

- To use Linux to create a secure managed gateway (Linux)

- Hibernate Performance Optimization of reusing SessionFactory (Programming)

- REDO LOG records management (Database)

- Linux Getting Started tutorial: Experience QEMU virtual machine articles (Linux)

- VMware Workstation + Ubuntu 10.04 Download the Android 2.2 source code (Linux)

- How to make GRub instead of the default Ubuntu software center (Linux)

- Scope of variables in C # (Programming)

- Android Fragment everything you need to know (Programming)

- Java multi-threaded communications pipeline flow (Programming)

- Using open source software to build XWiki Wiki system installed within the company (Linux)

- CentOS 6.5 start ActiveMQ being given to solve (Server)

- CentOS 7 RHEL 7 to reset the root password (Linux)

- Linux Getting Started tutorial: hard disk partition and to deal with traps (Linux)

- Linux iptables firewall settings (Linux)

- Linux use logs to troubleshoot (Linux)

- The Rabbitmq installation under CentOS 6.4 (Linux)

 
         
  HTML5 Application Cache
     
  Add Date : 2017-01-08      
         
         
         
  Use HTML5, by creating a cache manifest file, you can easily create offline versions of web applications.

What is the application cache (Application Cache)?

HTML5 introduces application cache, which means that web applications can be cached, and can be accessed without an Internet connection.

Application cache application brings three advantages:

Offline browsing - users can use them in the application offline
Speed - cached resources load faster
Reduce server load - the browser will only download updated or changed resources from the server.
Browser Support

All major browsers support the application cache, in addition to Internet Explorer.

HTML5 Cache Manifest examples

The following example shows the HTML document with a cache manifest (for offline viewing):

Examples

< ! DOCTYPE HTML>
< Html manifest = "demo.appcache">

< Body>
The content of the document ......
< / Body>

< / Html>
Try it yourself

Cache Manifest basis

To enable application cache, the label contains the manifest attribute in the document < html>:

< ! DOCTYPE HTML>
< Html manifest = "demo.appcache">
...
< / Html>
Each manifest specified page when users access their will be cached. If the manifest attribute is not specified, the page will not be cached (unless directly specify the page in the manifest file).

Suggested manifest file extension: ". Appcache".

Please note, manifest files need to configure the correct MIME-type, namely "text / cache-manifest". You must be configured on the web server.

Manifest file

manifest file is a simple text file that tells the browser contents of the cache (and does not cache content).

manifest files can be divided into three parts:

CACHE MANIFEST - in the heading of this document will be cached after the first download
NETWORK - In this title the following documents need to connect to the server, and will not be cached
FALLBACK - In this listed under the heading documents rollback pages (eg page 404) when the page is inaccessible
CACHE MANIFEST

The first line, CACHE MANIFEST, is required:

CACHE MANIFEST
/theme.css
/logo.gif
/main.js
The above manifest file lists three resources: a CSS file, a GIF image, and a JavaScript file. When the manifest file is loaded, the browser will download the three files from the root directory of your site. Then, whenever the user disconnects from the Internet, these resources are still available.

NETWORK

The following provisions of subsections NETWORK file "login.asp" will never be cached and available offline is unavailable:

NETWORK:
login.asp
You can use an asterisk to indicate that all other resources / files require an Internet connection:

NETWORK:
*
FALLBACK

FALLBACK sections defined below If you can not establish an Internet connection, with "offline.html" alternative / html5 / directory of all files:

FALLBACK:
/ Html5 / /404.html
Note: The first URI is the resource, the second is a substitute.

refresh cache

Once the application is cached, it will remain cached until the following occurs:

Users Clear your browser cache
manifest file is modified (see tips below)
By the program to update the application cache
Example - Complete Manifest file

CACHE MANIFEST
# 2012-02-21 v1.0.0
/theme.css
/logo.gif
/main.js

NETWORK:
login.asp

FALLBACK:
/ Html5 / /404.html
Important tip: the "#" at the beginning of the comment line, but also to meet other purposes. Caching application will be updated when its manifest file changes. If you edit a picture, or modify a JavaScript function, these changes will not be re-cached. Update comment line is a date and version number of the browser to re-cache file approach.

Notes on Application Cache

Please pay attention to the contents of the cache.

Once the files are cached, the browser will continue to display the cached version, even if you edit the file on the server. To make sure your browser to update the cache, you need to update the manifest file.

Note: The browser capacity limit for cached data may not be the same (some restrictions browser settings is that each site 5MB).
     
         
         
         
  More:      
 
- Linux how to view the graphics models notebook (Linux)
- How to recover deleted files in Linux systems (Linux)
- Linux Security (Linux)
- ARM Linux system call (Linux)
- PHP call a Python program (Programming)
- Android 4.2 compilation notes (Programming)
- Golang environment configuration recommendations (Linux)
- CentOS install Memcached (Server)
- MYSQL root password for the database user passwords are weak attack analysis (Linux)
- Python context managers (Programming)
- MySQL 5.6.26 source install (Database)
- Use Observium to monitor your network and servers (Server)
- How to install the client sqlplus under linux (Database)
- nginx.conf Optimization (Server)
- MySQL uses mysqld_multi to deploy stand-alone multi-instance detail procedures (Database)
- Linux kernel log --dmesg (Linux)
- CentOS and RHEL installation under GAMIT10.6 (Linux)
- Vim Getting Started Tutorial (Linux)
- Android Sets the system screen brightness (Programming)
- Configure shared library PCRE (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.