我有一个关于页面速度和代码优化的问题.我有一个页面,通过AJAX调用几乎100%填充.我的问题是:对于我来说,编写几个空的div,spans,无论是在页面的HTML中,然后使用javascript填充这些元素,我会更快吗?或者,在javascript中创建这些元素并插入和追加它们会更快吗?我不确定是否存在很大差异.因此,非常感谢这方面的任何帮助/建议.
我正在使用Page Speed Insights https://developers.google.com/speed/pagespeed/insights_extensions来分析我们的网络应用的页面加载时间.结果显示启用压缩和优化图像为高优先级部分下的待办事项.如果我在Web服务器上启用gzip压缩,它会不会同时处理两者?
对于启用压缩" 页面速度说"使用gzip或deflate压缩资源可以减少通过网络发送的字节数."
对于优化图像, Page Speed表示"正确格式化和压缩图像可以节省许多字节的数据." 然后给出如下建议:
无损压缩someImage.jpg 可以节省22.1KiB(减少95%)并且还提供显示优化内容的链接.
我的问题: "优化图像"不是"启用压缩"的子集吗?
PageSpeed服务不应触及某些URL.根据https://developers.google.com/appengine/docs/python/config/appconfig#pagespeed,我只需要将这些网址添加到url_blacklist我的网站中app.yaml.但是,它似乎没有起作用.
这就是我所拥有的:
pagespeed:
enabled_rewriters:
- InlineImages
- CollapseWhitespace
- RemoveComments
- InlineJs
url_blacklist:
- http://*/code/out/*
- https://*/code/out/*
Run Code Online (Sandbox Code Playgroud)
此网址仍由PageSpeed服务处理:
http://www.dartlang.org/web-ui/observables/code/out/hello_world.html
我究竟做错了什么?如何以通用方式排除我的URL?(如果可能的话,我想使用*通配符来避免必须指定每个URL)
谢谢!
为什么在加载页面时首先加载HTML和CSS会更快.这个一般规则有什么例外(如果有的话)?
我已经在我的nginx服务器上安装了mod_pagespeed,我喜欢它.
最近,我在我的网站上安装了AMP帖子,所有固定链接现在都/amp/在URL的末尾.
问题是mod_pagespeed(此时)不支持AMP标记,因此控制台显示一些错误.但是当我?PageSpeed=off在放大器URL的末尾插入时,AMP会被验证.
所以,我想,如果可能的话,只为所有在末尾都有/ amp /的网址停用mod_pagespeed.
永久链接结构是: https://www.example.com/postname/
AMP的永久链接结构是: https://www.example.com/postname/amp/
因此,mod_pagespeed应该只适用于第一个永久链接结构.
我试图将其放入mod_pagespeed的代码如下:
pagespeed Disallow “https://*example.com/*/amp/*”;
Run Code Online (Sandbox Code Playgroud)
它不会被模块拒绝,但它不会关闭AMP帖子上的pagespeed模块.你能帮我解决这个问题吗?
提前谢谢了.
我一直在到处搜索,但找不到以下问题的答案。
有什么限制?每天有多少个请求?
先感谢您
我正在寻找Maven配置来最小化Spring Boot应用程序的js / css文件。对于普通的Java Web应用程序,以下配置有效
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
<webappDirectory>${project.build.directory}/min</webappDirectory>
<excludes>
<exclude>**/*-min.js</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>${project.build.directory}/min</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
但是当我用弹簧靴尝试这个
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
<webappDirectory>${project.build.directory}</webappDirectory>
<excludes>
<exclude>**/*-min.js</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
<excludes>
<exclude>**/*.js</exclude>
</excludes>
</configuration>
<goals>
<goal>repackage</goal>
</goals>
</execution> …Run Code Online (Sandbox Code Playgroud) 正如谷歌建议的页面性能,我将 webp 图像添加到我的项目中。但是我知道 Safari 不支持这种图像类型,所以我试图为 Safari 用户添加一个后备 png 图像。
我使用了下面的设置。这可以作为后备,但现在谷歌告诉我我再次使用了错误的图像类型。这不是正确的设置吗?
<div class="carousel-item"
style="background-image: url('http://a.webpurr.com/l8r1.webp'),
url('https://i.imgur.com/fVmGtb3.png')">
</div>
Run Code Online (Sandbox Code Playgroud) 我聘请了一名开发人员来提高我的网站加载速度。他建议将 AMP 用于 Wordpress 插件。他在移动设备和桌面设备上都给了我 100 分的满分。我对此非常怀疑,因为我的网站很重,其他开发人员甚至不会承诺 90+ 的分数。我很确定这个开发人员只是在骗我 - 我想知道我如何才能找到?
有人可以帮我诊断该网站以查明它是否真实吗?听起来好得令人难以置信。
https://developers.google.com/speed/pagespeed/insights/
2020 年 5 月 27 日,我使用了页面速度,我在桌面 (90+) 和移动设备 (85+) 上获得了相当不错的分数,但在 2020 年 5 月 28 日,指标似乎发生了巨大变化,我可以看到 PageSpeed新版本 (v6) 但这里没有提供适当的发行说明https://developers.google.com/speed/docs/insights/release_notes。
任何人都遇到过类似的问题,并发现 google pagespeed 确实进行了某些升级,如果可能,请提供一些参考。
pagespeed ×10
javascript ×3
amp-html ×2
api ×1
css ×1
dom ×1
html ×1
html5 ×1
image ×1
java ×1
lighthouse ×1
nginx ×1
optimization ×1
performance ×1
permalinks ×1
safari ×1
spring-boot ×1
upgrade ×1
web ×1
webp ×1