的mod_pagespeed其他域相结合的CSS [英] mod_pagespeed combine css on other domain

查看:149
本文介绍了的mod_pagespeed其他域相结合的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找的mod_pagespeed,以此来加快我的网站。我目前在一个单独的域加载我的CSS / JS加快这些资源的加载。不过,我喜欢我的CSS / JS分解成有用的功能块。这意味着,在最坏的情况下我可以具有半打CSS文件和被包括在单个页面上的相同数目的JS文件。

I've been looking at mod_pagespeed as a way to speed up my site. I currently load my CSS/JS from a separate domain to speed up loading of those resources. However, I like to break up my CSS/JS into useful functional chunks. This means, in the worst case scenarios I may have half a dozen CSS files and the same number of JS files being included on a single page.

所以我的问题是。如何使用的mod_pagespeed从不同的领域继续加载文件,而且使用combine_css / combine_js指令?

So my question is. How can I use mod_pagespeed to continue loading files from a different domain but also use the combine_css/combine_js directives?

推荐答案

是的,但你要么需要运行在这两个网站的mod_pagespeed(及授权两个站点),或者从其他域到一个重写的CSS / JS说运行的mod_pagespeed。

Yes, but you either need to run mod_pagespeed on both sites (and authorize both sites) or to rewrite the CSS/JS from the other domain to the one that runs mod_pagespeed.

例如,如果您已经安装的mod_pagespeed两个主网站( http://www.example.com )和静态内容的网站( http://static.example.com ),你可以添加:

For example, if you have mod_pagespeed installed on both your main site (http://www.example.com) and your static-content site (http://static.example.com), you can add:

ModPagespeedDomain http://static.example.com

www.example.com 你的 pagespeed.conf 文件,这将授权的mod_pagespeed重写这些资源并继续从该域为他们服务。请参见 HTTP://$c$c.google。 COM /速度/页的高速/文档/ domains.html#auth_domains 获取文档。

to your pagespeed.conf file on www.example.com and this will authorize mod_pagespeed to rewrite those resources and continue to serve them from that domain. See http://code.google.com/speed/page-speed/docs/domains.html#auth_domains for doc.

如果你想的mod_pagespeed重写从静态域资源到您的主域名,您可以添加:

If you want mod_pagespeed to rewrite resources from your static domain to your main domain you can add:

ModPagespeedDomain http://static.example.com
ModPagespeedMapRewriteDomain www.example.com static.example.com

它会告诉的mod_pagespeed在 static.example.com 来重写文件,并将其移动到 www.example.com >。

which will tell mod_pagespeed to rewrite files in static.example.com and move them to www.example.com.

如果您还有其他问题,请随时与我们联系,我们的官方邮件列表: HTTPS ://groups.google.com/group/mod-pagespeed-discuss

If you have more questions, feel free to contact us on our official email list: https://groups.google.com/group/mod-pagespeed-discuss

-Shawn Ligocki(的mod_pagespeed队)

-Shawn Ligocki (mod_pagespeed team)

这篇关于的mod_pagespeed其他域相结合的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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