Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Precache #18

Closed
zzarcon opened this issue Feb 15, 2016 · 4 comments
Closed

Disable Precache #18

zzarcon opened this issue Feb 15, 2016 · 4 comments

Comments

@zzarcon
Copy link
Contributor

zzarcon commented Feb 15, 2016

There's any way to fully disable all the cache? AKA toolbox.precache.

My problem with the actual behaviour is that is precaching all the assets, which in my case are > 60Mb because I have hundreds of images.

So, will be posible to remove the urlsToPrefetch and the toolbox.precache call?

Thanks!

@jkleinsc
Copy link
Owner

You can use the excludePaths option to exclude files from the precache.
From the README:
excludePaths - Array of paths to exclude from precache. Files can be filtered using regular expressions.

{
  excludePaths: ['index.html', new RegExp(/.\.map$/)],
}

Any paths specified here with be filtered out and not included in the urlsToPrefetch.

@zzarcon
Copy link
Contributor Author

zzarcon commented Feb 22, 2016

Not really, since the getFilesRecursively is using [ "**/*" ] as a globPatterns.

The solution is to use the ignore option in the multiGlob helper.

I just forked the repo and did the changes, but I'm not sure if those will follow the expected behaviour of the addon, if yes I can create a PR for it :)

Changes -> zzarcon@06478c1

@jkleinsc
Copy link
Owner

@zzarcon getFilesRecursively(srcDir, [ "**/*" ]) is using a directory that has been filtered out via broccoli-funnel that excludes any paths that are specified in excludePaths, so that directory should not have any files you wish to exclude, so the ignore option should be uneeded. Think of it this way - your output directory is copied to a temp dir and that temp dir excludes any files/paths excluded in the excludePaths option. Then when you do a getFilesRecursively, it is only pulling the files from that temp dir, not your output directory as a whole.

If you have an example of a specific structure that is failing to exclude, can you describe it further?

@jkleinsc
Copy link
Owner

Closing due to no response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants