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

cache.put receiving request and not the static files #22

Closed
wants to merge 1 commit into from

Conversation

EloyID
Copy link

@EloyID EloyID commented Apr 6, 2020

I'm not totally sure about this, just came here from your post. Verify it's correct, but I think cache.put should receive the request and not the html files

I'm not totally sure about this, just came here from your post. Verify it's correct, but I think cache.put should receive the request and not the html files
@Custard7
Copy link

Thanks for this @EloyID!

My service working was throwing an error because of the same line, causing quite a few oddities. I changed:
Line 88: caches.open(version).then(cache => cache.put(event.request.url, clonedResponse));
Line 99: caches.open(version).then(cache => cache.put(event.request.url, clonedResponse));

Now it is working very well for my app!

@ilan-schemoul
Copy link
Owner

Hey,
Thank you very much for your interest.
Actually the reason I put cache.put(HTMLToCache, clonedResponse) was because Meteor projects are SPA (single web page application) so every single page has the same HTML. It means that it was a waste a space to cache each page differently. Instead if HTML is request I always cache under the same request url ('/') and I serve it if HTML is required.

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

Successfully merging this pull request may close these issues.

3 participants