HTML5 Application Cache Mechanism

The HTML5 Application Cache mechanism assists us with the development of web applications that can work offline. Using this mechanism we should create a manifest file that lists the resources (files) we want the web browser to keep their copies offline.

The following code sample includes the demo.html file that refers sample.caching. The later lists the files that the web browser should keep their copies in order to allow the web application to work offline.

The following is the sample.html file. It includes the manifest attribute in the <html> tag. The URI address the manifest attribute is assigned with can be either a full complete address or a relational one.

<!DOCTYPE html>
<html manifest="sample.caching">
<head lang="en"><meta charset="UTF-8">
  <title>Application Cache Demo</title>
</head>
<body>
  <h2>Application Cache Demo</h2>
  <img src="android.png" width="480" />
  <br/>
  <img src="java.png" width="480" />
</body>
</html>

The following is the sample.caching file. It lists the files we want the web browser to keep their copies in order to allow an offline application to function.

CACHE MANIFEST

# version 1.0.0

demo.html
android.png
java.png

The following video clip explains the execution of this code sample, overviews its code and explains it.

You can find the source code of this code sample as well as many other code samples in the ‘Introduction to HTML5’ course at http://abelski.lifemichael.com.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

What are Anti Patterns?

Anti Patterns

Unlike design patterns, anti patterns just seem to be a solution. However, they are not a solution and they cause additional costs.

Virtual Threads in Java Professional Seminar

Virtual Threads in Java

The use of virtual threads can assist us with improving the performance of our code. Learn how to use virtual threads effectively.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences