You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,14 @@
1
1
# BC Cache Changelog
2
2
3
+
## Upcoming version 3.0.0 (2022-10-13)
4
+
5
+
This release has been tested with upcoming WordPress 6.1 and PHP 8.2.
6
+
7
+
### Added
8
+
9
+
* Add support for caching of HTTP headers [#28](https://github.com/chesio/bc-cache/issues/28). This is a major change and requires an update of `.htaccess` rules! See the [changes](https://github.com/chesio/bc-cache/commit/f3dc91ed7fbafbfeadb39b1b7c86e8cac1a09bea) to `.htaccess` example configuration.
10
+
* Core XML sitemaps are now cached as well [#49](https://github.com/chesio/bc-cache/issues/49).
Copy file name to clipboardExpand all lines: README.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ Modern and simple full page cache plugin for WordPress inspired by [Cachify](htt
7
7
8
8
BC Cache has no settings page - it is intended for webmasters who are familiar with `.htaccess` files and WordPress actions and filters.
9
9
10
+
BC Cache can cache not only HTML pages, but [core XML sitemaps](https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/) as well. Technically, any content type generated by WordPress for front-end requests routed via root `index.php` file can be handled provided that output generation triggers [`template_redirect`](https://developer.wordpress.org/reference/hooks/template_redirect/) hook.
11
+
10
12
## Requirements
11
13
12
14
* Apache webserver with [mod_rewrite](https://httpd.apache.org/docs/current/mod/mod_rewrite.html) enabled
@@ -17,8 +19,7 @@ BC Cache has no settings page - it is intended for webmasters who are familiar w
17
19
18
20
* BC Cache has not been tested on WordPress multisite installation.
19
21
* BC Cache has not been tested on Windows servers.
20
-
* BC Cache can only serve requests without filename in path, ie. `/some/path` or `some/other/path/`, but not `/some/path/to/filename.html`.
21
-
* BC Cache does not support [content negotation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation#the_accept_header). If contents of URL are deemed cacheable, content is always returned as `text/html` regardless of `Accept` header send by client.
22
+
* BC Cache does not support [content negotation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation) via `Accept` header.
# Main rules: serve only GET requests with whitelisted query string fields coming from anonymous users.
@@ -143,6 +142,8 @@ If there was a settings page, following filters would likely become plugin setti
143
142
144
143
*`bc-cache/filter:can-user-flush-cache` - filters whether current user can clear the cache. By default, any user with `manage_options` capability can clear the cache.
145
144
*`bc-cache/filter:html-signature` - filters HTML signature appended to HTML files stored in cache. You can use this filter to get rid of the signature: `add_filter('bc-cache/filter:html-signature', '__return_empty_string');`
145
+
*`bc-cache/filter:cached-response-headers` - filters HTTP response headers generated by WordPress/PHP that are kept when cache entry is created. These headers are then sent as additional response headers with cached content. By default following headers are kept: `Content-Type`, `Link`, `X-Pingback`, `X-Robots-Tag`, `X-BC-Cache-Generated`. Note that `Content-Type` header is crucial for proper delivery of cached content and thus is always preserved.
146
+
*`bc-cache/filter:cache-generation-timestamp-format` - filters format of cache generation timestamp. This timestamp is included in HTML signature and in `X-BC-Cache-Generated` HTTP response header. The value must be a valid `$format` argument for [`wp_date()`](https://developer.wordpress.org/reference/functions/wp_date/).
146
147
147
148
#### Filters for advanced functions
148
149
@@ -235,7 +236,7 @@ A response to HTTP(S) request is **not** cached by BC Cache if **any** of the co
235
236
2. Request is a GET request with one or more query string fields that are not whitelisted. By default, the whitelist consists of [Google click IDs](https://support.google.com/searchads/answer/7342044), [Facebook Click Identifier](https://fbclid.com/) and standard [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters), but it can be [filtered](#filters).
236
237
3. Request is not for a front-end page (ie. [`wp_using_themes`](https://developer.wordpress.org/reference/functions/wp_using_themes/) returns `false`). Output of AJAX, WP-CLI or WP-Cron calls is never cached.
237
238
4. Request comes from a non-anonymous user (ie. user that is logged in, left a comment or accessed password protected page/post). The rule can be tweaked to ignore [front-end users](#front-end-users-and-caching) if your theme supports it.
238
-
5. Request/response type is one of the following: XML sitemap, search, 404, feed, trackback, robots.txt, preview or password protected post.
239
+
5. Request/response type is one of the following: search, 404, feed, trackback, robots.txt, preview or password protected post.
239
240
6.[Fatal error recovery mode](https://make.wordpress.org/core/2019/04/16/fatal-error-recovery-mode-in-5-2/) is active.
240
241
7.`DONOTCACHEPAGE` constant is set and evaluates to true. This constant is for example [automatically set](https://docs.woocommerce.com/document/configuring-caching-plugins/#section-1) by WooCommerce on certain pages.
241
242
8. Return value of `bc-cache/filter:skip-cache` filter evaluates to true.
@@ -285,7 +286,7 @@ This way cached pages can be served to front-end users too. Cookie name and cont
285
286
286
287
## Request variants
287
288
288
-
Sometimes a different HTML is served as response to request to the same URL, typically when particular cookie is set or request is made by particular browser/bot. In such cases, BC Cache allows to define request variants and cache/serve different HTML responses based on configured conditions. A typical example is the situation in which privacy policy notice is displayed until site visitor accepts it. The state (cookie policy accepted or not) is often determined based on presence of particular cookie. Using request variants, BC Cache can serve visitors regardless if they have or have not accepted the cookie policy.
289
+
Sometimes a different response body is served to request to the same URL, typically when particular cookie is set or request is made by particular browser/bot. In such cases, BC Cache allows to define request variants and cache/serve different response body based on configured conditions. A typical example is the situation in which privacy policy notice is displayed until site visitor accepts it. The state (cookie policy accepted or not) is often determined based on presence of particular cookie. Using request variants, BC Cache can serve visitors regardless if they have or have not accepted the cookie policy.
289
290
290
291
### Request variant configuration example
291
292
@@ -312,7 +313,7 @@ The [default configuration](#installation) needs to be extended as well and set
Important: Variant names are appended to basename part of cache file names, so `index.html` becomes `index_cna.html` and `index.html.gz` becomes `index_cna.html.gz` in the example above. To make sure your setup will work, use only letters from `[a-z0-9_-]` range as variant names.
316
+
Important: Variant names are appended to basename part of cache file names, so `index` becomes `index_cna` and `index.gz` becomes `index_cna.gz` in the example above. To make sure your setup will work, use only letters from `[a-z0-9_-]` range as variant names.
0 commit comments