Prevent img tag being altered for "above the fold" rules

352 views
Skip to first unread message

Andy Cheng

unread,
Feb 13, 2014, 9:15:32 AM2/13/14
to ngx-pagesp...@googlegroups.com
Hi,

I have an image tag initially with src="", it is actually a placeholder that my javascript will change the image source dynamically.
However, I recently discover pagespeed will change the tag as following:

Original:
<img src="">

Altered:
<img style="display:none;visibility:hidden;" data-cfsrc="" pagespeed_url_hash="1352311551" src="http://my.dynamic.source/image.png">

After some research, I suspect pagespeed altered the tag for the "above the fold" rule and I don't seem to find a way to prevent it.

Is there any attribute that I can add to prevent the tag to be altered?

Thank you

Andy


Jeff Kaufman

unread,
Feb 13, 2014, 9:17:34 AM2/13/14
to ngx-pagesp...@googlegroups.com
Could you add the "pagespeed_no_transform" no transform attribute to
this img tag? This should keep PageSpeed from modifying it.
> --
> You received this message because you are subscribed to the Google Groups
> "ngx-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ngx-pagespeed-di...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ngx-pagespeed-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.

Andy Cheng

unread,
Feb 13, 2014, 9:37:39 PM2/13/14
to ngx-pagesp...@googlegroups.com
Hi Jeff,

Thank you so much for your pointer.
The "pagespeed_no_transform" attribute works like it supposes to (thanks for the new trick!)
However, after a few experiments I realized that it is not caused by pagespeed, but Cloudflare Mirage 2.
After turning it off, the "hidden" style is gone and the problem is fixed.

Thanks again for the help

Andy

Jeff Kaufman於 2014年2月13日星期四UTC+8下午10時17分34秒寫道:
Could you add the "pagespeed_no_transform" no transform attribute to
this img tag?  This should keep PageSpeed from modifying it.

On Thu, Feb 13, 2014 at 9:15 AM, Andy Cheng <an...@cloudmobo.com> wrote:
> Hi,
>
> I have an image tag initially with src="", it is actually a placeholder that
> my javascript will change the image source dynamically.
> However, I recently discover pagespeed will change the tag as following:
>
> Original:
> <img src="">
>
> Altered:
> <img style="display:none;visibility:hidden;" data-cfsrc=""
> pagespeed_url_hash="1352311551" src="http://my.dynamic.source/image.png">
>
> After some research, I suspect pagespeed altered the tag for the "above the
> fold" rule and I don't seem to find a way to prevent it.
>
> Is there any attribute that I can add to prevent the tag to be altered?
>
> Thank you
>
> Andy
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "ngx-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
Reply all
Reply to author
Forward
0 new messages