Search code examples
meteorhtml5-appcache

How to investigate what is in the Meteor appCache


I recently added the Meteor appcache package and since I had the following error message:

** You are using the appcache package but the total size of the
** cached resources is 7.6MB.
**
** This is over the recommended maximum of 5 MB and may break your
** app in some browsers! See http://docs.meteor.com/#appcache
** for more information and fixes.

It is hard to believe that my scripts have that size, and my /public is completely empty. In Firefox I went to about:cache and looked at the appcache - but I only saw my script files there, though it might have included outdated versions of the same file. [Searching for localhost:3000/packages/jquery.js yielded two results, with different IDs.] No script file was bigger than 200KB so I can hardly imagine reaching 7.6MB.

Is this only development related and if not, how else can I see what Meteor is putting in the appcache to reach this size?


Solution

  • In production, the appcache will be smaller.

    You can view the appcache for an individual page in Chrome by going to View > Developer > Developer Tools, then Resources > Application Cache. (about:cache in Firefox appears to show the cache for all sites.)

    These are my findings:

    • When I run my site during development, the largest file is jQuery which takes up 1.2 MB (a bit odd considering the unminified jQuery is only about 250k).

    • When I run my site in production (using meteor run --production or deploying the site for real), the largest file is a single 756k JavaScript file. This leaves plenty of room for images and such.