wordpress打开缓存_WordPress缓存指南

wordpress打开缓存

When a site isn’t working the way it’s intended to, I’m sure you’ve asked yourself — “Should I clear the cache?”

当网站无法正常运行时,我确定您已经问过自己:“我应该清除缓存吗?”

Caching has been a part of our vocabulary, thanks to web browsers and their implementation of the same, but in this post, let’s try to go beyond the layman’s understanding of caching and implement it in our website to increase efficiency.

由于网络浏览器及其实现,缓存已成为我们词汇的一部分,但是在本文中,让我们尝试超越外行的理解,并在我们的网站中实现缓存以提高效率。

As your site grows, you would realize that you need to change your strategy to manage all the new traffic you get — right from scaling up your servers to making sure you increase the efficiency along the way.

随着站点的增长,您将意识到需要改变策略来管理所获得的所有新流量-从扩展服务器到确保在整个过程中提高效率。

什么是缓存 (What Caching Is)

In the simplest of terms, a cache is a temporary storage, and caching is the process of storing data in a cache. How does that help a WordPress webmaster? Let’s break down the steps of what happens behind the scenes when a reader opens a page on your site.

用最简单的术语来说, 高速缓存是临时存储,而高速缓存是将数据存储在高速缓存中的过程。 这对WordPress网站管理员有什么帮助? 让我们分解一下读者打开您的网站页面时幕后发生的步骤。

Caching in websitesCaching in websites 网站缓存
[Source] [来源]

First, the browser sends a request to the URL on your site. Your web server responds to the request by making a few database queries to get information like title, body, and comments, and returns an HTML document. This HTML document is read by the browser and rendered as a page that you see — which is possible by downloading all the stylesheets, scripts and images associated with the HTML document.

首先,浏览器将请求发送到您网站上的URL。 您的Web服务器通过进行一些数据库查询来获取标题,正文和注释之类的信息,以响应该请求,并返回HTML文档。 该HTML文档被浏览器读取,并呈现为您看到的页面-这可以通过下载与HTML文档关联的所有样式表,脚本和图像来实现。

There’s a possibility of delay at each step in the process described above. Your web server may be down with too many requests, your database server may not be responding, the server which hosts other files like scripts and images may be unresponsive.

在上述过程中,每个步骤都有延迟的可能。 您的Web服务器可能因太多请求而停机,您的数据库服务器可能没有响应,承载其他文件(如脚本和图像)的服务器可能没有响应。

Caching helps remove some of these steps in between by creating copies of commonly requested items like database queries, images or whole pages. Caching is beneficial when you host content that doesn’t change much over time — such as a match report about the recent World Cup final. You can simply cache a version of the page which is rendered every time a user visits the link.

缓存通过创建常见请求项的副本(例如数据库查询,图像或整个页面)来帮助消除其中的某些步骤。 如果您托管的内容不会随时间变化太多(例如有关

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值