Title: LH Add Headers
Author: shawfactor
Published: <strong>2016 年 5 月 6 日</strong>
Last modified: 2017 年 5 月 2 日

---

搜索插件

![](https://ps.w.org/lh-add-headers/assets/banner-772x250.jpg?rev=1411420)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/lh-add-headers/assets/icon-128x128.png?rev=1411420)

# LH Add Headers

 作者：[shawfactor](https://profiles.wordpress.org/shawfactor/)

[下载](https://downloads.wordpress.org/plugin/lh-add-headers.zip)

 * [详情](https://cn.wordpress.org/plugins/lh-add-headers/#description)
 * [评价](https://cn.wordpress.org/plugins/lh-add-headers/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/lh-add-headers/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/lh-add-headers/#developers)

 [支持](https://wordpress.org/support/plugin/lh-add-headers/)

## 描述

A `304 Not Modified HTTP Header` tells your visitors that nothing has changed since
their last visit. This is important as without this header visitors may be downloading
your webpages from scratch each time, slowing down their experience and your site.

Generally if you do not pass `304 Not Modified HTTP Header` through your HTTP header,
crawlers will fetch your whole website and then compare the content of your site
with the already indexed content to check whether anything new has been updated 
on your website or not. But this process consumes a lot of your server resource 
and bandwidth.

You can know more about it [here](http://www.feedthebot.com/ifmodified.html).

#### Before reading any further

Before reading any further it is important to understand this plugin uses output
buffering, in fact the Etag sent by this plugin is a hash of the sites buffered 
content. If your site uses server side caching this plugin may break the caching
functionality. Therefore I suggest that you please **make sure** you have studied
the FAQ, before installation and activation.

## 安装

 1. Upload the entire `lh-add-headers` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress. That is it.

## 常见问题

  Installation Instructions

 1. Upload the entire `lh-add-headers` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress. That is it.

  Will this plugin cause problem if you use server side caching?

Quite possibly depending on your setup. It could prevent caching or even break your
site if you are using server side caching (including Varnish). This plugin should
NOT be used on hosts like WPEngine or DreamPress as it will break caching.

  How do I check if it is working?

Install one of the the view live HTTP headers tools in your browser. Visit your 
website and then refresh the page. On your second visit the website should return
a 304 not modified response.

  Are there other reason why a 304 header is not being return when I haven’t changed
the content?

In order to to return 304 the hash of the returned content must be the same (IE 
the html must be identical between requests.
 Unfortunately, some plugin adding 
dynamic and varying content to each page output returned. Try disabling each plugins
to find the culprit.

  What are the benefits?

This helps visitors and search engines. If your page or post has not been updated
since the last visit, then your page will sent a `304 Not Modified Header`. On receipt
of this header search engines know nothing has changed (and therefore there is no
need to re crawl your site), likewise a normal visitors browser will get a 304 and
will use the browser side cache of the page (thus speeding up the visitors experience).

## 评价

此插件暂无评价。

## 贡献者及开发者

「LH Add Headers」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ shawfactor ](https://profiles.wordpress.org/shawfactor/)

[帮助将「LH Add Headers」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/lh-add-headers)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/lh-add-headers/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/lh-add-headers/)，或通过[RSS](https://plugins.trac.wordpress.org/log/lh-add-headers/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/lh-add-headers/)。

## 更新日志

**1.00 April 15, 2016**
 Initial release.

**1.01 May 05, 2016**
 Code improvement

**1.02 May 19, 2016**
 Fixed customiser issue

**1.03 June 22, 2016**
 Fixed documentation link

**1.04 April 30, 2017**
 Added class check

**1.05 May 10, 2017**
 Keep comments in outputted source

## 额外信息

 *  版本 **1.04**
 *  最后更新：**9 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.1.0 或更高版本 **
 *  已测试的最高版本为 **4.8.28**
 *  语言
 * [English (US)](https://wordpress.org/plugins/lh-add-headers/)
 * 标签
 * [cache-control](https://cn.wordpress.org/plugins/tags/cache-control/)[caching](https://cn.wordpress.org/plugins/tags/caching/)
   [expires](https://cn.wordpress.org/plugins/tags/expires/)[headers](https://cn.wordpress.org/plugins/tags/headers/)
   [last-modified](https://cn.wordpress.org/plugins/tags/last-modified/)
 *  [高级视图](https://cn.wordpress.org/plugins/lh-add-headers/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/lh-add-headers/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/lh-add-headers/reviews/)

## 贡献者

 *   [ shawfactor ](https://profiles.wordpress.org/shawfactor/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/lh-add-headers/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://lhero.org/portfolio/lh-add-headers/)