1

I have a huge set of JavaScript files that need to be added to the App cache. Is it possible to add an entire folder(JS folder) in the Manifest. Else, I'll have to manually add those JS files to the manifest.

2 Answers 2

4

Your manifest file doesn't need to be a static file. Just write some server side code to generate a manifest based on the files in the folder.

Sign up to request clarification or add additional context in comments.

2 Comments

Could you please elaborate? Appreciate your help.. Newbie here :)
The browser does an HTTP request for the manifest, just like a web page. So just like a web page you can have an ASPX, PHP or whatever you server language is handler that generates the response.
0

As Maurice has pointed out, you can generate the file dynamically.

Or better still, have a background task do the work when the contents of the folder changes.

Node.js is good for this if you are already familiar with JS and have control over the server so that it can be installed. Node comes with capabilities for watching files and folders & there are a number of libraries available to make the job simple.

One key issue to watch out for though is the combined size of the files. Many browsers that support HTML5 offline use, put strict limits on the amount of data you can store offline. Typically the default limit is 5MB.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.