Optimal image size to inline

12 views
Skip to first unread message

Dmitrii Kustov

unread,
Jan 29, 2015, 3:50:40 PM1/29/15
to mod-pagesp...@googlegroups.com
Hello. Working on this website https://www.hyperlinksmedia.com , got interested in the question of inlining small images.

I know that default size to inline is set to 2048 bytes.

My question is: do you guys have some kind of recommended MAXIMUM value to set this filter to, NOT taking each indiviudal website in consideration ?


ModPagespeedImageInlineMaxBytes XYZ

P.S. If there is no data or opinion on this, I'll do practical test research, I guess.

Jeff Kaufman

unread,
Jan 29, 2015, 3:56:42 PM1/29/15
to mod-pagespeed-discuss
You could run an experiment to see what's fastest for your site:
https://developers.google.com/speed/pagespeed/module/module-run-experiment

Generally, though, I wouldn't expect inlining large images to be
helpful unless (a) you're also inlining all the css and js your page
uses or (b) all those resources are referenced earlier in the html
than the inline image. Even then You probably don't want to go above
~30k of inline images total.
> --
> You received this message because you are subscribed to the Google Groups
> "mod-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mod-pagespeed-di...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/597a4121-09ff-403c-bdf6-1d590e06b18f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Dmitrii Kustov

unread,
Jan 29, 2015, 4:33:07 PM1/29/15
to mod-pagesp...@googlegroups.com
Thanks for reply.

I do understand that inlining large images doesn't make sense. I was talking about bumping up from 2kb to, let's say, 3kb. Or 4kb or 5kb  :)

Because, like at the moment i have 6 images which are around 2.6 kb. So, they wouldn't be inlined without changing the settings. Also, i do realize that most likely 0.5kb increase per image won't affect CPU much. But at one point it might be too many to inline.


As you said:

Even then You probably don't want to go above
~30k of inline images total.

It's "probably", right? Any data on this at all?

On Thursday, January 29, 2015 at 2:56:42 PM UTC-6, Jeff Kaufman wrote:
You could run an experiment to see what's fastest for your site:
https://developers.google.com/speed/pagespeed/module/module-run-experiment

Generally, though, I wouldn't expect inlining large images to be
helpful unless (a) you're also inlining all the css and js your page
uses or (b) all those resources are referenced earlier in the html
than the inline image.  Even then You probably don't want to go above
~30k of inline images total.

On Thu, Jan 29, 2015 at 3:50 PM, Dmitrii Kustov
<dmi...@hyperlinksmedia.com> wrote:
> Hello. Working on this website https://www.hyperlinksmedia.com , got
> interested in the question of inlining small images.
>
> I know that default size to inline is set to 2048 bytes.
>
> My question is: do you guys have some kind of recommended MAXIMUM value to
> set this filter to, NOT taking each indiviudal website in consideration ?
>
>
>> ModPagespeedImageInlineMaxBytes XYZ
>
>
> P.S. If there is no data or opinion on this, I'll do practical test
> research, I guess.
>
> --
> You received this message because you are subscribed to the Google Groups
> "mod-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Jeff Kaufman

unread,
Jan 30, 2015, 8:14:32 AM1/30/15
to mod-pagespeed-discuss
On Thu, Jan 29, 2015 at 4:33 PM, Dmitrii Kustov
<dmi...@hyperlinksmedia.com> wrote:
>
> I do understand that inlining large images doesn't make sense. I was talking
> about bumping up from 2kb to, let's say, 3kb. Or 4kb or 5kb :)
>
> Because, like at the moment i have 6 images which are around 2.6 kb. So,
> they wouldn't be inlined without changing the settings. Also, i do realize
> that most likely 0.5kb increase per image won't affect CPU much. But at one
> point it might be too many to inline.
>

Makes sense. The best thing to do is to run an experiment and find
out. Or at least run a bunch of runs on webpagestest.org,
interleaving A-vs-B.

>> Even then You probably don't want to go above
>> ~30k of inline images total.
>
> It's "probably", right? Any data on this at all?

No data, just my impression.

This sort of thing depends a lot on the rest of your page, making
general guidelines not that useful.

Dmitrii Kustov

unread,
Jan 30, 2015, 10:09:27 AM1/30/15
to mod-pagesp...@googlegroups.com
Thanks a lot!
Reply all
Reply to author
Forward
0 new messages