jekyll-theme-chirpy
jekyll-theme-chirpy copied to clipboard
fix(pwa): avoid caching large files
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Improvement (refactoring and improving code)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
Description
I'm going to try to solve an issue related to caching files that are chunked for transfer (usually they have a 206 status) that we have discussed here GH-1651. To avoid this error, we should only cache files that have a response code of 200.
@cotes2020 What do you think if I fix the 206 code to filter the request and finalize this PR, but create a new discussion to find a better solution?
@cotes2020 What do you think if I fix the 206 code to filter the request and finalize this PR, but create a new discussion to find a better solution?
I didn't elaborate on this much, but I have seen the problem in action as it causes errors for newly developed features and so should be fixed before release, I think.
Is there anything else we should fix except 206? I mean maybe it's a good idea to fix what we have discovered so far only?
The comments I left above were mainly to get your opinions on whether there is a better solution.
Unless you have a better way, detecting whether the response status code is 206 is an acceptable solution.
If innerResponse’s status is 206, return a promise rejected with a TypeError.
@cotes2020 added the changes to your comment
~Sorry guys, I made a mistake while reviewing, returning directly after event.request.headers.has('range') is met would have the undesirable result that fontwesome styles could not be cached.~
~So, I'm going to rewrite this commit to fix this issue.~
Update:
Everything works fine, it's my browser extension that interferes with the test results, the Fontawesome icons can be cached correctly. Sorry for the disruption.
:tada: This PR is included in version 7.0.0 :tada:
The release is available on:
v7.0.0- GitHub release
Your semantic-release bot :package::rocket: