Google mod_pagespeed用于Ajax加载的内容 [英] Google mod_pagespeed for ajax loaded content

查看:100
本文介绍了Google mod_pagespeed用于Ajax加载的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用mod_pagespeed优化和转换图片,它对于html文件中的所有标签都非常有效.但是如何处理加载了js的图像?例如幻灯片演示中的图像等.

I`m trying to optimze and convert images using mod_pagespeed and it works very good for all tags in html files. But how could it process images that loaded with js? For example images in slideshows and etc.

谢谢!

推荐答案

mod_pagespeed通常通过在HTML中检测图像和其他资源的URL,然后将URL替换为指向优化版本的链接来优化图像和其他资源.但是,从mod_pagespeed 1.4.26.1开始,mod_pagespeed包含一项名为就地资源优化<的功能. /a>,可以优化使用其原始URL请求的资源.可以在像您这样通过AJAX请求图像的情况下使用.可以通过在配置文件中设置ModPagespeedInPlaceResourceOptimization on来启用它,并查看上面链接的文档以获取更多详细信息.

mod_pagespeed normally optimizes images and other resources by detecting their URL in the HTML and then replacing the URL with a link to the optimized version. As of mod_pagespeed 1.4.26.1 however, mod_pagespeed includes a feature called In-Place Resource Optimization, which allows resources requested with their original URL to be optimized. This can be used in cases like yours where images are being requested through AJAX. It can be enabled by setting ModPagespeedInPlaceResourceOptimization on in your config file, and have a look at the documentation linked above for more details.

这篇关于Google mod_pagespeed用于Ajax加载的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆