appcache-webpack-plugin icon indicating copy to clipboard operation
appcache-webpack-plugin copied to clipboard

Multiple AppCachePlugin instances cause caching of the other caches!

Open tomhicks-bsf opened this issue 10 years ago • 1 comments

We use a build that exports multiple cache manifests, for different devices/platforms. Something like:

plugins: [
  new AppCachePlugin({
    exclude: [/ios/],
    name: "android.appcache"
  }),

  new AppCachePlugin({
    exclude: [/android/],
    name: "ios.appcache"
  })
]

Problem is, that produces an iOS appcache that includes the android appcache! I can't think of any reason why anyone would want to cache the appcache, and in fact that can lead to an impossible-to-update application.

Should we automatically exclude /\/\.appcache$/ files?

tomhicks-bsf avatar Sep 24 '15 13:09 tomhicks-bsf

Hmm, caching the appcache can never end well, so maybe we should consider some kind of guard here.

Now that we've allowed output to be configured (thanks again!), I'm not sure we can rely on a pattern to protect us from this scenario. Perhaps we could come up with a solution that will automatically exclude the configured output filenames across all instances of the plugin (a 'global' registry, or something).

In the meantime (in case you haven't tried this already), you should be able to add those appcache filenames (or a pattern like /*.\.appcache$/) to your exclude option(s).

lettertwo avatar Sep 24 '15 15:09 lettertwo