Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Regarding Chrome's Image-Breaking Timeout Bug

Go to End

15 Posts   4951 Views

Shauna G

3 March 2010 at 9:53am Community Member, 52 Posts

Uncle Cheese,

You might already be aware of this, but Chrome has a...ahem...wonderful little bug in it that causes it to time out on some image-heavy sites, thus only partially downloading the images.

[url=]Google support forum 1[/url]
[url=]Google support forum 2[/url]
(For those that don't know.)

My issue is that my site has large enough image galleries (and images) that it's triggering this timeout (and I get an endless loading overlay). I noticed when looking at the rendered code that the page renders all of the images, even if they're not all visible.

What I was thinking was a way to sort of "optimize" the loading time for the galleries by, perhaps, only rendering the visible ones. However, I don't know if that's even possible, and since you seem to be more familiar with image galleries in general, I was wondering if you'd have some insight into that. I'm thinking it'd be on the PHP end, where it only retrieves the X set of images, though I'm not seeing anything obvious in your code for getting the images and putting them in the generated list. Also, if I understand how SilverStripe handles images and thumbnails (the _resampled folder), the thumbnails are already generated, as I loaded up the galleries in a different browser, first. So, unless SS rebuilds the thumbnails every time, the hangup shouldn't be in that generation sequence.

I understand that this solution would result in longer load times between gallery pages, but it would lower the initial load time and (theoretically) allow visitors using Chrome to load the galleries at all.

So, would that be possible (at least with Image_Gallery/SS)? If so, which function is controlling that? If not, do you suppose there's another way I could work around Chrome's bug?


3 March 2010 at 10:59am 4085 Posts

Yeah, I was opposed to adding this in, but people really liked that you could paginate past the current page in the lightbox.

I don't think we need some heroic effort of programming to change the presentation, though. Just override the so exclude the PreviousGalleryItems and NextGalleryItems.


<div class="gallery-layout-wrapper">
   <% if GalleryItems %>
   <ul class="gallery-layout" id="gallery-list">
      <% control GalleryItems %>
      <% end_control %>
   <% end_if %>

Shauna G

3 March 2010 at 11:21am Community Member, 52 Posts

Would that still keep the pagination? I do like the ability to only display a select number of images, as it cleans up the page and makes it look more professional (especially on galleries with 80 images).


3 March 2010 at 2:54pm 4085 Posts

Yeah, pagination shouldn't be affected.

Shauna G

4 March 2010 at 4:53am Community Member, 52 Posts

Okay, this is dumb... Chrome still won't load the image gallery images, even if I set it to only show one image per page after the template change you suggested. It's odd, too, because it loads the auto-generated image lists on the static site (simple PHP function that gets all the images from a given folder and loads them into a list), and that doesn't have pagination at all, so all 70+ images are loaded into the page and are visible. What makes it even more strange is that I have a jQuery carousel on the front page that has about a dozen images (image size range is roughly 150kb, currently hard-coded into the template for time's sake) that it loads just fine.


4 March 2010 at 5:03am 4085 Posts

Have you confirmed that there's only one image in your source code? Did the template change work?

Shauna G

4 March 2010 at 5:19am Community Member, 52 Posts

After a little coaxing with Chrome, I was able to get it to see that the template change worked (it works in Firefox, confirmed by Firebug), but Chrome still won't load the image. It just sits with the endlessly spinning loading gear. Chrome's developer tools shows that it downloads the image, but it doesn't seem to get rid of the loading gear in place of the images.

Perhaps it's that layering? I'm grasping at straws here, at the moment. I figure maybe if I get rid of the loading overlay, it might remedy the issue (worth a shot, at least).


4 March 2010 at 6:36am 4085 Posts

Check JS errors.

Go to Top