Jump to content

Weird performance issue with $image->width(400)->url;


Recommended Posts

Hey there,

I've got a site with a weird performance issue. Requesting ~20 pages and displaying them with $image->width(400)->url can take up to 2-3 seconds. The resized images are already generated.

If I replace that line with $image->url the request is almost instantaneous, as it should be. So it seems like the width() function is struggling for whatever reason. Could it be something with permissions on the files under /assets/files that is causing this?

An example of the file with ls -lah looks like this:

-rw-r--r--    1 www-data www-data 510K May  8 10:32 20_10_xxx_web.800x0.png

The original (is fast) looks like this

-rwxrwx---    1 joe     www-data 1.3M Mar 16 16:36 20_10_xxx_web.png*

I should probably restrict the permission a bit, but first I'm looking to understand this slow down.



Link to comment
Share on other sites


That actually works, but I think it might be for the wrong reason. There can't actually be any slowdowns because of permissions, I suppose? It has to be something else. Not sure what exactly yet, but I'll see if i can find out.

  • Like 1
Link to comment
Share on other sites

Awesome that it works. It was meant more for testing if all image functions take so much time.
This way we know there is something weird happening with width() - yet I am not sure what it could be right now.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...