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.

NoSQL Databases Courses, Seminars, Consulting, and Development

MongoDB Design Patterns Meetup

The use of MongoDB involves with various cases in which we can overcome performance issues by implementing specific design patterns.

image of woman and database

Record Classes in Java

Learn how to define record classes in Java, and when to use record classes in your code. Stay up to date with the new Java features.

Accessibility | Career | Conferences | Design Patterns | JavaScript | Meetups | PHP | Podcasts | Python | Self Learning

Teaching Methodologies | Fullstack | C++ | C# | CSS | Node.js | Angular | Java | Go | Android | Kotlin | Swift | Academy

Front End Development | Scala | Architectures | Cloud | Big Data | Internet of Things | Kids Learn Programming

The Beauty of Code

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

Skip to content Update cookies preferences