We accidentally published changes to webapp that should have been restricted to Meteor 1.10 as part of the 1.8.1 version. This commit reverts commits to packages/webapp since Meteor 1.9, so that we can republish the 1.8.0 content as version 1.8.2. We will then bump the webapp version to 1.9.0 on the release-1.10 branch and publish the new content only on that branch. Revert "Allow to exclude web architectures in development mode (#10824)" This reverts commita205967186. Revert "Updates cordova-plugin-meteor-webapp to 1.7.1" This reverts commita1e4d27822. Revert "Update cordova-plugin-wkwebview-engine to 1.2.1." This reverts commit3f9a69d7c4. Revert "Update cordova-plugin-whitelist to 1.3.4." This reverts commit979273333b. Revert "Update cordova-plugin-meteor-webapp to 1.7.1-beta.1." This reverts commit565c4254f1. Revert "Update accounts-password to version 1.5.2." This reverts commitb827d1da2f.
appcache
Source code of released version | Source code of development version
The appcache package, part of
Webapp, stores the static parts of a
Meteor application (the client side Javascript, HTML, CSS, and images)
in the browser's application
cache.
Using Appcache
To enable caching
simply add the appcache package to your project.
-
Once a user has visited a Meteor application for the first time and the application has been cached, on subsequent visits the web page loads faster because the browser can load the application out of the cache without contacting the server first.
-
Hot code pushes are loaded by the browser in the background while the app continues to run. Once the new code has been fully loaded the browser is able to switch over to the new code quickly.
-
The application cache allows the application to be loaded even when the browser doesn't have an Internet connection, and so enables using the app offline.
(Note however that the appcache package by itself doesn't make
data available offline: in an application loaded offline, a Meteor
Collection will appear to be empty in the client until the Internet
becomes available and the browser is able to establish a DDP
connection).
To turn AppCache off for specific browsers use:
Meteor.AppCache.config({
chrome: false,
firefox: false
});
The supported browsers that can be enabled or disabled include, but are
not limited to, android, chrome, chromium, chromeMobileIOS,
firefox, ie, mobileSafari and safari.
Browsers limit the amount of data they will put in the application cache, which can vary due to factors such as how much disk space is free. Unfortunately if your application goes over the limit rather than disabling the application cache altogether and running the application online, the browser will instead fail that particular update of the cache, leaving your users running old code.
Thus it's best to keep the size of the cache below 5MB. The
appcache package will print a warning on the Meteor server console
if the total size of the resources being cached is over 5MB.
If you have files too large to fit in the cache you can disable caching by URL prefix. For example,
Meteor.AppCache.config({onlineOnly: ['/online/']});
causes files in your public/online directory to not be cached, and
so they will only be available online. You can then move your large
files into that directory and refer to them at the new URL:
<img src="/online/bigimage.jpg">
If you'd prefer not to move your files, you can use the file names themselves as the URL prefix:
Meteor.AppCache.config({
onlineOnly: [
'/bigimage.jpg',
'/largedata.json'
]
});
though keep in mind that since the exclusion is by prefix (this is a
limitation of the application cache manifest), excluding
/largedata.json will also exclude such URLs as
/largedata.json.orig and /largedata.json/file1.
For more information about how Meteor interacts with the application cache, see the AppCache page in the Meteor wiki.