-
Notifications
You must be signed in to change notification settings - Fork 683
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
[bug]: responses with 404 code should not be cached #2551
Comments
Created PWA-749 in backlog for grooming |
@mercs600 Thanks for your patience. Maybe the simplest solution here would be to remove the The only reason we'd keep this middleware is if there's a severe performance degradation when you remove it. Can you do me a favor, @mercs600, and remove the apicache middleware entirely, and see what happens to your development and staging server performance? |
@magento I am working on this |
Describe the bug
Hi guys. I see we use
apicache
connected with hastly to optimize and cache images. We face with the issue caching of 404 responses on media proxy. I mean when something is wrong with the media server and proxy is not able to create image then we get 404, but after when media server is back and images are available, then cache is still valid and we see 404 error page still.The second issue is about webp support and caching:
When you make a deploy and you open the website on Chrome first (which supports webp) you will be able to see webp images. Then if you open the same page on the safari (which doesn't supports webp) you won't be able to see images because they were cached as webp with the first hit ( on chrome)
To reproduce
Steps to reproduce the behavior:
Expected behavior
Images with 404 and error headers should not be cached.
Screenshots
![Zrzut ekranu 2020-07-13 o 10 38 12](https://user-images.githubusercontent.com/7935392/87282998-22513380-c4f5-11ea-8213-e01c6a2b212a.png)
Possible solutions
My solution is simple according to documentation of apicache, but should we done it here or maybe it should be fixed on server side, because this solution is transfering the headers ?
EDIT
include, exclude option in statusCode brings no results until we changed second parameter of apicache instance this is
hastily.hasSupportedExtension:
(req, res) => hastily.hasSupportedExtension(req) && res.statusCode === 200
Can I change this setup from my project level - webpackConfig or somewhere ? Because now I have to modify packages/pwa-buildpack/lib/Utilities/addImgOptMiddleware.js to make it works.
Please let us know what packages this bug is in regards to:
venia-concept
venia-ui
pwa-buildpack
peregrine
pwa-devdocs
upward-js
upward-spec
create-pwa
The text was updated successfully, but these errors were encountered: