-
Notifications
You must be signed in to change notification settings - Fork 86
Too much redirecting when using the image optimizer on Netlify #540
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
Comments
Hi. The delay is unlikely to be due to the redirects, but is rather because on first load it needs to load and resize the image. It should be faster for subsequent visitors though, as the result is then cached. |
@ascorbic What you're saying is correct, it is faster after first load however its still doing redirects to the "nextimg" after caching and the process is not an ideal speed, other reason is it just adds alot of bloat to the network tab. Is no redirect supposed to occur after initial caching and if so is there a variable I am missing perhaps? I can DM you the website specifically I am referring to. |
Fixed in edge functions #1310 |
* test: explicitly mark test route handler as cacheable * test: explicitly mark test route handler as non cacheable
Describe the bug
I noticed the images which use the image optimizer perform much slower when accessed on our Netlify build which I assuming is due to the redirect overhead the current setup requires.
Looks like it starts here: https://github.com/netlify/netlify-plugin-nextjs/blob/7d01abaaefe86983319438b9a6bec22b90763ce6/src/lib/steps/setupRedirects.js#L58
mydomain.com/_next/image -> mydomain.com/nextimg -> mydomain.com/.netlify/functions/whatever
Versions
Anyway we can avoid this / cut down on the redirecting?
The text was updated successfully, but these errors were encountered: