Sergey Metlov
Sergey Metlov

Reputation: 26311

iPad safari mobile JavaScript files caching

Does iPad Safari cache JavaScript files? It seems to be no. If my Safari doesn't cache scripts, how can I make it to do that?

Upvotes: 2

Views: 1044

Answers (1)

Zymotik
Zymotik

Reputation: 7337

Creating a Manifest File (See here for declaring a manifest file)

The manifest file specifies the resources—such as HTML, JavaScript, CSS, and image files —to downloaded and store in the application cache. After the first time a webpage is loaded, the resources specified in the manifest file are obtained from the application cache, not the web server.

The manifest file has the following attributes:

  • It must be served with type text/cache-manifest.

  • The first line must contain the text CACHE MANIFEST.

  • Subsequent lines may contain URLs for each resource to cache or comments.

  • Comments must be on a single line and preceded by the # character.

  • The URLs are file paths to resources you want to download and cache locally. The file paths should be relative to the location of the manifest file—similar to file paths used in CSS—or absolute.

  • The HTML file that declares the manifest file, described in Declaring a Manifest File, is automatically included in the application cache. You do not need to add it to the manifest file.

Excerpt from: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/Client-SideStorage/Client-SideStorage.html

More info about the HTML5 Offline Application Cache

Upvotes: 2

Related Questions