سؤال

Well, adding it will be no problem, but how can I generate the cache manifest? I would need to somehow get the paths to the combined CSS and JS that Meteor generates. http://www.whatwg.org/specs/web-apps/current-work/#manifests

هل كانت مفيدة؟

المحلول

Update:

As user1506145 said:

meteor add appcache

https://atmospherejs.com/meteor/appcache

This answer is out of date:

The answer lies in the bundler package, I autogenerated a manifest file there. You can get a full list of css and js files by hooking into: bundle.css and bundle.js.client

Once you have managed to get them a manifest file you will need to do the following with a manifestcontent var you have generated (dont forget to exclude from caching all the meteor urls needed):

buffer.files.client_cacheable['manifest.appcache'] = new Buffer(manifestcontent);

This will have your application serving the appcache file. Then you can edit /app/lib/app.html.in to add the reference in.

My issue when I did this was that I wasn't able to stale the cache often enough so it ended up with an application messed up on reload from the server.

نصائح أخرى

You may automatically generate and include the manifest by adding the appcache package.

meteor add appcache

https://atmospherejs.com/meteor/appcache

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top