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

very slow page load #287

Closed
tkart38 opened this issue Oct 6, 2020 · 4 comments
Closed

very slow page load #287

tkart38 opened this issue Oct 6, 2020 · 4 comments
Labels

Comments

@tkart38
Copy link

tkart38 commented Oct 6, 2020

hi i've notice that the image loading is very very slow.
any advice?

Immagine 2020-10-06 171934

@pjdevries
Copy link

I'm experiencing the same and second this request for advice.

@tgalopin
Copy link
Member

Hi!

This is probably due to the resource-intensity of image processing, and unfortunately, this is something difficult to fix.

There are ways you can decrease this intensity:

  • Decrease the image of the source file: on upload, resize the source file for instance to maximum 2500x2500. This will avoid having too big image being manipulated by Glide at runtime ;
  • Put as many images as you can in cache. Don't hesitate to put very long cache mechanisms in place, as the parameters of the URL define what the image should look like so it works very well with HTTP cache (Varnish for instance)
  • Finally, try to find which operation is the slowest. By using a tool like Blackfire you can try to find which operation on the image is the slowest: the resize, an overlay, a color manipulation, etc. If this operation can be optimized (perhaps by precalculating things, or creating an image you can simply embed instead of build at runtime), you can perhaps decrease the time necessary to render the image

Generally speaking however, Glide was design as a runtime library. That makes it very flexible because the source images are used at runtime, but it also makes it a slower than simply rendering images that were already built. That's kinda normal :) . Depending on your situation, it may make sense to prepopulate Glide cache at upload for some settings.

@pjdevries
Copy link

Thanks for your swift reply @tgalopin

I will take your suggestions at heart and see if I can improve things.

@ADmad
Copy link
Collaborator

ADmad commented Mar 4, 2021

Closing as there's nothing to be done in Glide's code for this issue.

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

No branches or pull requests

4 participants