XF 1.5 A page taking up 142 MB due to animated GIF attachments

Ralle

Active member
Hey guys,

I have this page which if loaded in your browser takes up 142 MB of bandwidth. Is there any way to not download all attachments unless clicked?
 

Mike

XenForo developer
Staff member
That would effectively be lazy loading images (though image attachments). That would require custom development/an add-on.
 

Ralle

Active member
I was actually expecting attachment images to be thumbnailed and loaded that way until clicked. Is this not the case?
 

Brent W

Well-known member
Hey guys,

I have this page which if loaded in your browser takes up 142 MB of bandwidth. Is there any way to not download all attachments unless clicked?
There is a bit you can do that is free. CloudFlare, for instance, will improve things for you with your images. It may not solve the problem completely but will save you bandwidth and get your images to your users faster.

I recommend also looking into https://www.centminmod.com/. Much better than apache for this imo.
 

Ralle

Active member
Thanks for the suggestions, but the main bottleneck remains that a huge number of GIFs are being loaded when they shouldn't. Switching to CF or Nginx wouldn't change the fact that people's internet would have to download 150 megs.
 

Mike

XenForo developer
Staff member
I was actually expecting attachment images to be thumbnailed and loaded that way until clicked. Is this not the case?
Well there are several variables. Uses can insert full size attachments, so that would bypass that. If they didn't insert the full size attachments, then the thumbnail version will be used; if you use the out of the box image processor (GD), this will only be the first frame. If you use ImageMagick, then this will be an animated thumbnail and thus can still potentially be sizeable.
 

Ralle

Active member
Okay. I see. I know there exist some lazy loading image systems around the web. They work best if you already know the size of images. Would it be a correct assumption that all image sizes are known if ImageProxy is being used?
 

Mike

XenForo developer
Staff member
No, external image sizes are not known to the code outputting the pages. (Attachment image sizes could be known, though we also use responsive image techniques.)
 

Ralle

Active member
That's why I said image proxy. External images are cached, so they must be known? I looked in the table 'xf_image_proxy' and it does not store the width and height :S. This shouldn't be too hard to make though. It would make for a really lazily loaded XenForo. I am thinking of making an addon for this. Any sort of gotcha's about the image proxy data? Does it guarantee a valid image? Is the mimetype always correct?
 
Top