pagespeed

Nginx下安装配置PageSpeed模块,轻松完成网站提速

青春壹個敷衍的年華 提交于 2019-11-30 21:04:36
作为 Nginx 组件, ngx_pagespeed 将重写你的网页,让用户以更快的速度进行访问。重写的工作包括压缩图片、缩减CSS和JavaScript、扩展缓存时间,同样还包括其它一些最佳实践: 优化缓存——整合应用程序的数据和逻辑 最小化round-trip次数——削减连续的请求/响应周期数 最小化请求开销——削减上传大小 最小化负载大小——削减响应、下载及缓存页面大小 优化浏览器渲染——改善浏览器页面布局 移动方面的优化——优化站点移动网络和设备方面的相关特性 本文是基于 LNMP 环境,LNMP脚本参考: 《LNMP最新源码安装脚本》 下载解压 PageSpeed 模块 cd /r oot/lnmp/source wget https://github.com/pagespeed/ngx_pagespeed/archive/release-1.5.27.3-beta.zip unzip -q release-1.5.27.3-beta wget https://dl.google.com/dl/page-speed/psol/1.5.27.3.tar.gz tar xzf 1.5.27.3.tar.gz -C ngx_pagespeed-release-1.5.27.3-beta/ 查看线上版本编译参数 # /usr/local/nginx/sbin/nginx -V

htaccess UTF-8 encoding for .html, .css, .js - Whats the best way?

时光毁灭记忆、已成空白 提交于 2019-11-30 07:24:33
问题 For yslow page speed I want to remove my meta tag and put my encoding into the .htaccess file. Below are all the ways to do it I have read about. Which is the preferred way? Also is the language setting a good idea too - and if out side of the filesmatch will it apply to all file types? 1) https://github.com/jancbeck/My-Wordpress-Boilerplate/blob/master/htaccess.txt AddDefaultCharset utf-8 AddCharset utf-8 .html .css .js DefaultLanguage en-US vs 2) http://www.askapache.com/htaccess/using-http

Using Accelerated Mobile Pages with Bootstrap

不打扰是莪最后的温柔 提交于 2019-11-30 02:16:27
问题 I have a website that uses Bootstrap. Technically, I'm using Bootstrap 4 at the moment. I want to leverage Accelerated Mobile Pages (AMP) in the publicly-facing parts of my page. However, I have several errors that I can't seem to shake. This has me wondering, can I even use Bootstrap with an Accelerated Mobile Page? Am I even allowed to use JavaScript in Accelerated Mobile Pages? Bootstrap has JavaScript for the hamburger menu on mobile phones. Yet, when I run the validator, I see errors

how to stop using google page speed

点点圈 提交于 2019-11-29 23:12:27
I have a wordpress website I'm creating for a client temporarily hosted on http://dev.eatfit.co.nz/ I'm noticing that often (but not every time) that I browse a page (for example the home page), what I assume is the google pagespeed online service seems to rewrite the url's on the fly to optimise things, so I get urls like this coming back to me (viewable in fiddler or in the .html source) http://dev.eatfit.co.nz/wp-content/themes/eatfit/images/xfoot-logo.png.pagespeed.ic.SWoJqa9Ly9.png I do not want to happen and I want to turn off the google pagespeed as it is incorrectly optimising the css

.htaccess: How to “Specify a cache validator”?

青春壹個敷衍的年華 提交于 2019-11-29 23:03:21
I'm running Google PageSpeed on my site and it's tell me that I need to "Specify a cache validator." The following resources are missing a cache validator. Resources that do not specify a cache validator cannot be refreshed efficiently. Specify a Last-Modified or ETag header to enable cache validation for the following resources: ... then it lists images, CSS, JS, etc. According to http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching : Set the Last-Modified date to the last time the resource was changed. If the Last-Modified date is sufficiently far enough in the

Set HTTP Caching Expiration, Recommended by Google PageSpeed

吃可爱长大的小学妹 提交于 2019-11-29 21:07:55
I ran tests on my website using Google's PageSpeed and it recommends that I "Leverage browser caching" and provided the following resource: http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching This resource never explains how to actually change the expiration date of my http headers. Do I do this through .htaccess? I would like to set the caching for as long as possible (without violating Google's policy of a year max). Any advice on recommended settings (for a custom php-driven social networking community) would be greatly appreciated. In your root's .htaccess:

What happened to the “Use efficient CSS selectors” rule?

谁都会走 提交于 2019-11-29 19:33:48
问题 There was a recommendation by Google PageSpeed that asked web developers to Use efficient CSS selectors: Avoiding inefficient key selectors that match large numbers of elements can speed up page rendering. Details As the browser parses HTML, it constructs an internal document tree representing all the elements to be displayed. It then matches elements to styles specified in various stylesheets, according to the standard CSS cascade, inheritance, and ordering rules. In Mozilla's implementation

Web tips for improving speed of my website?

ⅰ亾dé卋堺 提交于 2019-11-29 13:05:00
Provide some useful tips as How can I improve the speed of my website? What are the advantages & disadvantages of using sub domains? My website is CareerMitra.com use pageSpeed (google) and Yslow (Yahoo) browser's extensions (with firebug or not) for view ALL good pratices for improve your website faster. For sample : this is a list of good practises checked by Yslow in your Website : Minimize HTTP Requests Use a Content Delivery Network Avoid empty src or href Add an Expires or a Cache-Control Header Gzip Components Put StyleSheets at the Top Put Scripts at the Bottom Avoid CSS Expressions

would lazy-loading img src negatively impact SEO

◇◆丶佛笑我妖孽 提交于 2019-11-29 10:34:42
I'm working on a shopping site. We display 40 images in our results. We're looking to reduce the onload time of our page, and since images block the onload event, I'm considering lazy loading them by initially setting img.src="" and then setting them after onload. Note that this is not ajax loading of html fragments. the image html along with the alt text is present. it's just the image src is deferred. Does anyone have any idea as to whether this may harm SEO or lead to a google penalty box now that they are measuring sitespeed? Images don't block anything, they are already lazy loaded. The

Is it practically good to put JS files at the bottom of webpage?

狂风中的少年 提交于 2019-11-29 06:59:23
It is widely recommended that JS files should be put at the bottom of page to allow html codes to be loaded first. In this case, visitors will see something when waiting for full load of the page. However, I think this is disadvantageous for these reasons: Modern design mainly depends on JS. This means before loading JS, the page will look ugly. If interrupting the connection during the load (not loading JS at all), visitors will miss some of the website features (probably very important); and they will not understand that this is the problem of load (to re-load the page). If the server-side