简体   繁体   English

图像优化以更快地加载网页

[英]Image optimization to load webpage faster

I have checked several thread in stackoverflow about this. 我已经在stackoverflow中检查了几个关于此的线程。 I have followed several content over the net to compress the images. 我在网上关注了一些内容以压缩图像。 I have checked- 我检查过-

mod_deflate
mod_headers
mod_expires

for my Apache server. 为我的Apache服务器。 After two days searching I am posting here about this issue. 经过两天的搜索,我将在此处发布有关此问题的信息。 I have tried headers, expires to write in .htaccess file. 我试过头文件,到期后写在.htaccess文件中。 Nothing is working. 什么都没用。 No changes are showing in Google Page Speed Insights . Google Page Speed Insights没有显示任何更改。 I also have tried W3 Total Cache , WP Super Cache , Force GZip in WP . 我还尝试了W3 Total CacheWP Super CacheForce GZip in WP I need to optimize images. 我需要优化图像。 What can I do? 我能做什么? Please, suggest me. 请给我建议。

Total Platform of my website is as follows- 我网站的总平台如下-

  1. cPanel 面板
  2. Apache Server Apache服务器
  3. WordPress WordPress的
  4. MySQL 的MySQL

Your question is borderline opinion-based, but... One thing you could try is domain sharding . 您的问题是基于边界观点的,但是...您可以尝试的一件事是域分片 The idea is you create extra DNS records. 这个想法是您创建额外的DNS记录。

Say you have mydomain.com . 假设您有mydomain.com Create img1.mydomain.com , img2.mydomain.com , img3.mydomain.com . 创建img1.mydomain.comimg2.mydomain.comimg3.mydomain.com Now when you build your pages as you create the src attribute for your img tags you loop across these domains. 现在,当您为img标签创建src属性时构建页面时,就会在这些域之间循环。

The idea is this tricks browsers into spawning more threads to load the images. 这个想法是欺骗浏览器产生更多线程来加载图像。 Your mileage may vary. 你的旅费可能会改变。

Another thing you may consider would be a CDN , but it's pretty hard to suggest the best course of action here without more information. 您可能会考虑的另一件事是CDN ,但是很难在没有更多信息的情况下提出最佳的行动方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM