首页 > 解决方案 > Woocommerce 网站 6-7 秒页面加载

问题描述

我有一个基于 wordpress 的 Woocommerce 电子商务网站。

我使用 WP-Rocket 插件进行缓存

我用 CND

我使用云专用服务器:9CPU X 2GHZ 7GB Ram Apache

对于缓存页面,页面加载非常好,只需 1-1.5 秒。但是未缓存的页面需要 6-7 秒,这是一个动态电子商务网站,大多数页面加载都是未缓存的。在我的主题附带的网站搜索和无限滚动功能中,它需要 5-7 秒。我尝试更改我的托管服务提供商并尝试使用高级 wordpress 托管服务 Kinsta,但没有任何改变。我应该怎么做才能减少这个页面加载。当我单击 chrome 中的新类别灰色等待图标时需要 3-4 秒,当它变成蓝色时只需要 1-2 秒。我认为主要问题是这个。我将添加相同的屏幕截图云,请检查一下

这是用于未更改的页面。

这是无限滚动

这是用于网站搜索

标签: phpmysqlwordpresswoocommercepagespeed

解决方案


There is very little detailed instructions I can give you based on the fact that this is a debugging project. However, I can provide you with some tools and advice.

The first thing you wan to do is eliminate that it is your hosting. A decent minimal hosting environment should be able to run WordPress and WooCommerce on the Storefront theme (https://wordpress.org/themes/storefront/) with times around 400-600ms with no caching. Better hosting can produce better times. So install that theme and disable ALL plugins except WooCommerce and check your TTFB times. If they are still high, then it is a hosting issue. It may or may not be resource allocation that can be fixed by adjusting the hosting environment. However, that's a different question.

Assuming that the TTFB times reach the target range of 400-600ms in that configuration, you can proceed to determine the cause of your slowdown.

First, enable all of the plugins you are using again except the caching plugin. Check your speed. It should go up some, but not too much. If you are back at the >5000ms then you can bet your issues are with one (or more) of the plugins. Turn them all off and then turn them on one at a time checking the speed after each activation. It is also possible that there is a conflict between plugins. If you find that plugins are your problem, then you should seek out new ones to replace that functionality or do custom development.

Next enable your desired theme. You should do this with all the plugins enabled in case there are dependencies. If this is the cause of your slowdown then you have a couple of options. One is to install some debugging plugins and try to determine if you can fix those issues in a child theme or to work with the theme developer to integrate changes. The second is to find another theme that will meet your needs. And lastly, you can build one yourself or do a child theme of Storefront.

Some good debugging plugins that can show where issues exist are:

Debug Bar - https://wordpress.org/plugins/debug-bar/ (there are additional plugins that add features to the main plugin as well)

Query Monitor - https://wordpress.org/plugins/query-monitor/ (best for database related issues)


推荐阅读