<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WP Super Cache相关文章列表 | 皇家元林</title>
	<atom:link href="https://hjyl.org/tags/wp-super-cache/feed/" rel="self" type="application/rss+xml" />
	<link>https://hjyl.org</link>
	<description>刘元林的个人博客</description>
	<lastBuildDate>Mon, 04 Sep 2023 02:07:09 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://img.hjyl.org/uploads/2019/10/cropped-about-me-32x32.png</url>
	<title>WP Super Cache相关文章列表 | 皇家元林</title>
	<link>https://hjyl.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>博客开启Redis服务</title>
		<link>https://hjyl.org/wordpress-wpsupercache-redis/</link>
					<comments>https://hjyl.org/wordpress-wpsupercache-redis/#comments</comments>
		
		<dc:creator><![CDATA[皇家元林]]></dc:creator>
		<pubDate>Mon, 04 Sep 2023 02:07:07 +0000</pubDate>
				<category><![CDATA[元林手札]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[Redis Object Cache]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Super Cache]]></category>
		<category><![CDATA[博客]]></category>
		<guid isPermaLink="false">https://hjyl.org/?p=4596</guid>

					<description><![CDATA[什么是Redis？ REmote DIctionary Server(Redis) 是一个由 Salvator [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>什么是Redis？</p>
<cite>REmote DIctionary Server(Redis) 是一个由 Salvatore Sanfilippo 写的 key-value 存储系统，是跨平台的非关系型数据库。<br>Redis 是一个开源的使用 ANSI C 语言编写、遵守 BSD 协议、支持网络、可基于内存、分布式、可选持久性的键值对(Key-Value)存储数据库，并提供多种语言的 API。<br>Redis 通常被称为数据结构服务器，因为值（value）可以是字符串(String)、哈希(Hash)、列表(list)、集合(sets)和有序集合(sorted sets)等类型。<br>——来自于<a href="https://hjyl.org/go/aHR0cHM6Ly93d3cucnVub29iLmNvbS9yZWRpcy9yZWRpcy10dXRvcmlhbC5odG1s" rel="nofollow" target="_blank">Redis 教程 | 菜鸟教程 (runoob.com)</a></cite></blockquote>



<p>到底是个什么东西呢？我感觉他是以key-value键值的形式可以长久存在于内存的数据库，即将MySQL查询的数据库存于内存当中，以达到高效并发，网站秒开的目的。</p>



<p>之前一直用WP Super Cache插件，效果也还可以，他只能减轻PHP的压力，但不能降低数据库的查询。这段时间从内网穿透到反向代理，我感觉本站打开速度没以前那么快了。查询WP Super Cache插件的脚本记录发现打开首页需要查询151次数据库，耗时0.8秒，内存占用30多M。所以才想到要尝试一下Redis。</p>



<p>这几天也了解了一下，安装也很简单。如果你是用<a href="https://hjyl.org/go/aHR0cHM6Ly9sbm1wLm9yZy9mYXEvYWRkb25zLmh0bWw=" rel="nofollow" target="_blank">军哥的lnmp</a>，ssh到安装文件夹下，输入以下命令即可：</p>



<pre class="wp-block-code"><code>./addons.sh install redis</code></pre>



<p>如果是宝塔，抱歉我没用过，你搜搜其他教程看看，估计也很简单。</p>



<p>然后WordPress博客用一个插件：Redis Object Cache，开启搞定！如果你一个服务器上多个站点，有可能会混乱，可以参考<a href="https://hjyl.org/go/aHR0cHM6Ly9oaWxhdS5jb20vMTY4MS8=" rel="nofollow" target="_blank">这篇文章</a>设置。</p>



<p>WP Super Cache + Redis的方案目前没遇到冲突，而且查询的次数降到了15次，内存占用近40M，效果还是很明显的。</p>
<div id="content-copyright"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;font-size: 13px;">版权声明: </span><span style="font-size: 13px;">本文采用 <a href="https://hjyl.org/go/aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC8=" rel="nofollow" target="_blank">BY-NC-SA</a> 协议进行授权，如无注明均为原创，转载请注明转自 <a href="https://hjyl.org">皇家元林</a><br>本文链接: <a rel="bookmark" title="博客开启Redis服务" href="https://hjyl.org/wordpress-wpsupercache-redis/">博客开启Redis服务</a></span></div>]]></content:encoded>
					
					<wfw:commentRss>https://hjyl.org/wordpress-wpsupercache-redis/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
	</channel>
</rss>
