Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML attributes to exclude mod_pagespeed

Is there any HTML attributes available to exclude files that do not use mod_pagespeed?.

My requirements is like below

< script src="demo.js" type="text/javascript" pagespeed="no">

Thanks

like image 800
Jaya Prakash Avatar asked Jun 20 '26 14:06

Jaya Prakash


1 Answers

If you want to make sure that mod_pagespeed does not change the URL of your JS, I think you have to do that in configuration. For example:

ModPagespeedDisallow http://www.example.com/demo.js

See documentation.

mod_pagespeed does have a data-pagespeed-no-transform attribute. For example,

<img src="example.png" data-pagespeed-no-transform>

See documentation.

However, this is only documented to work for avoiding image optimization, I don't know if it works for JS optimization as well.

Also note that this will simply stop us from transforming the contents of the image, not from extending it's cache (and changing the URL).

like image 154
sligocki Avatar answered Jun 25 '26 07:06

sligocki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!