Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Regarding Chrome's Image-Breaking Timeout Bug

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 4555 Views
  • Shauna G
    Avatar
    Community Member
    52 Posts

    Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    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.

    Google support forum 1
    Google support forum 2
    (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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    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 GalleryUI_layout.ss so exclude the PreviousGalleryItems and NextGalleryItems.

    /your_theme_dir/templates/includes

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

  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    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).

  • UncleCheese
    Avatar
    4085 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    Yeah, pagination shouldn't be affected.

  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

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

  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    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).

  • UncleCheese
    Avatar
    4085 Posts

    Re: Regarding Chrome's Image-Breaking Timeout Bug Link to this post

    Check JS errors.

    4555 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.