4

I just updated a large EE 2.5.2 install to Assets 2.0 and updated indexes. Everything went smoothly, and I've noticed a strange new behavior: thumbnail generation (any size) in the admin panel will temporarily block the website from loading Assets images.

To reproduce:

  1. Choose a large (100+ item) Assets folder to browse in the admin panel. Any view/thumbnail size will have the same effect.

  2. While the thumbnails are loading, navigate to a page on the public website that uses Assets tags in its template.

The result: the page in #2 will stall until all thumbnails in #1 have finished loading. Immediately after finishing, the public page will load.

This is on a MediaTemple DV4 server with 2048MB RAM and plenty of resources, and several httpd instances. Could the mysql process be the bottleneck? What else might cause this to happen?

Edit: This appears to be limited to the same session. I originally tried this with Chrome 24 (Mac), running both #1 and #2 in different tabs. When I instead tried #2 in Firefox, there was no blocking and everything loaded as expected. Now I'm not sure if I've got a problem worth solving or a minor annoyance to live with.

  • Hey Matt - I'd like to see this in action on your setup and see if we can help. For this particular case, can you email support@pixelandtonic.com please? Thank you! – Lisa Jan 16 '13 at 16:27
  • Just sent Lisa, thanks! Is it good form to delete this question or leave it for posterity? Used to Stack Overflow, but new to this EE Stack Exchange business. – Matt Stein Jan 16 '13 at 17:52
  • Let's troubleshoot it then make sure the answer gets posted here for others to find. :) – Lisa Jan 16 '13 at 19:54
  • Did you see Andris' answer as well? It seems this may actually be quite reasonable. :) – Lisa Jan 16 '13 at 19:54
  • I did see Andris' answer – the request limit makes sense but I'm not sure why generated thumbnails don't appear to be cached properly. – Matt Stein Jan 16 '13 at 21:06
6

this is because on the first request to a folder, Assets will create thumbnails appropriate for your screen (retina or not).

For 100+ files, that's 100+ requests that aren't instant and browsers limit simultaneous requests to the same server, so it's browser hitting the limit because of the initial processing required.

After this, though, the images will be created and stored and you shouldn't experience it for the same folder again. Even more - if you use the same browser, these images will be cached and won't make any requests at all.

Hope this clears things up for you!

| improve this answer | |
  • Thanks Andris. This makes plenty of sense, though it appears the thumbnails are regenerated every time I hit a folder. Each request seems to have healthy Cache-Control and Expires headers, but also a Pragma: no-cache. Starting to smell like a server configuration problem. wrkcpt.com/image/2f2m0p192i2z – Matt Stein Jan 16 '13 at 21:08
  • Sounds like it. Just tested on my end, and I’m not getting Pragma: no-cache headers in my thumb requests. – Brandon Kelly Jan 16 '13 at 23:09
2

This answer is for posterity. My issue ended up being a combination of the browser request limit Andris mentioned and Pragma: no-cache headers that were being passed by ExpressionEngine 2.5.2. I confirmed that they were coming from ExpressionEngine in two environments, though commenting out all relevant header() references failed to solve the problem.

I fixed this for now by adding Header unset Pragma to my .htaccess directive. This clearly fixes my missed cache issue, and I'm fairly sure that it doesn't have negative consequences anywhere else.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.