.Net Interview Questions and Answers

Search:

What is application cache in HTML5?( ASP.NET HTML 5 interview questions with answers)

By : Shiv Prasad Koirala | Dec 14th, 2013 | Views : 3064 | Comments : 0 Bookmark and Share

One of the most demanded things by end user is offline browsing. In other words if internet connection is not available page should come from browser cache i.e. offline and application cache helps you to achieve the same.


Application cache helps you to specify which files should be cached and not cached.


So how do we implement application cache in HTML 5 ?

The first thing in we need to specify is the "manifest" file. "manifest" file helps you to define how your caching should work. Below is the structure of the manifest file :-


CACHE MANIFEST
# version 1.0
CACHE :
Login.aspx


  • All manifest file starts with CACHE MANIFEST statement.
  • #( hash tag) helps to provide the version of the cache file.
  • CACHE command specifies which files needs to be cached.
  • The content type of the manifest file should be "text/cache-manifest".


Below is how cache manifest has been provided using ASP.NET C#.


Response.ContentType = "text/cache-manifest";

Response.Write("CACHE MANIFEST \n");

Response.Write("# 2012-02-21 v1.0.0 \n");

Response.Write("CACHE : \n");

Response.Write("Login.aspx \n");

Response.Flush();

Response.End();


One the cache manifest file is created the next thing is to provide the link of the manifest file in the HTML page as shown below.


manifest="cache.aspx">


When the above file runs first time it gets added in the browser application cache and in case server goes down the page is served from the application cache.


So how do we refresh the application cache of the browser?

Application cache is removed by changing version number to a new version number as specified in the "#" tag in the below code.


CACHE MANIFEST
# version 2.0(new)
CACHE :
Login.aspx


In case you are going for ASP.NET interview please do see the below interview revision video provided by www.questpond.com


 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi