apache_conf 添加过期标题以加速WordPress网站

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf 添加过期标题以加速WordPress网站相关的知识,希望对你有一定的参考价值。

## Use snippets for adding expires headers

While there are many different things you can do in order to make your site faster I'm going to post a little snippet to add in your .htaccess file that will set your Expire Headers time.
The faster your site loads the better is for your SEO and for your Bounce Rates.

Expire Headers is letting your browser to cache your website content and request them only after the time specified in that rule expires.

If you want to set a separate Expire Headers rule for each of your filetypes then you can use the following snippet on your .htaccess.

<code>ExpiresByType image/png A2592000</code><br>
<code>ExpiresByType image/gif A2592000</code><br>
<code>ExpiresByType image/jpg A2592000</code><br>
<code>ExpiresByType image/jpeg A2592000</code><br>
<code>ExpiresByType text/javascript A2592000</code><br>
<code>ExpiresByType application/x-javascript A2592000</code><br>
<code>ExpiresByType text/css A2592000</code>
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|svg|js|css|woff|ttf)$">
ExpiresActive On
ExpiresDefault A2592000
</FilesMatch>

以上是关于apache_conf 添加过期标题以加速WordPress网站的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 过期标题

apache_conf 过期标题.htaccess代码。

apache_conf 加速代码段4缓存启动器

apache_conf 加速WordPress自托管站点。此内容在#BEGIN WordPress之前进入.htaccess文件。

apache_conf WordPress .htaccess配置文件。允许强制SSL,隐藏wp-config.php,标头ETag,GZIP压缩和过期缓存。

Redis,性能加速的催化剂