質問

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

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top