Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
set content-length header for html if there is no compression active;
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Yarosh committed Sep 28, 2021
1 parent 85b2fad commit 38723fd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions PgCache_ContentGrabber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,15 @@ private function _maybe_save_cached_result( $buffer, $response_headers, $has_dyn
// Calculate content etag
$etag = md5( $buffer );

// Pass content-length in case there are no compression methods enabled
if(
$compressions_to_store === [false] &&
$this->_config->get_boolean( 'browsercache.enabled' ) &&
(!$this->_config->get_boolean( 'browsercache.html.compression' ) && !$this->_config->get_boolean( 'browsercache.html.brotli' ))
){
$headers['Content-Length'] = strlen($buffer);
}

// Send headers
$this->_send_headers( $is_404, $time, $etag, $compression_header,
$headers );
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "glomex/w3-total-cache",
"description": "Altered version of W3TC plugin with support for internal Glomex infrastructure",
"type": "wordpress-plugin",
"version": "2.1.8.2",
"version": "2.1.8.3",
"require-dev": {
"roave/security-advisories": "dev-master"
},
Expand Down
2 changes: 1 addition & 1 deletion w3-total-cache-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

define( 'W3TC', true );
define( 'W3TC_VERSION', '2.1.8.2' );
define( 'W3TC_VERSION', '2.1.8.3' );
define( 'W3TC_POWERED_BY', 'W3 Total Cache' );
define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' );
define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' );
Expand Down
2 changes: 1 addition & 1 deletion w3-total-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: W3 Total Cache
* Plugin URI: https://www.boldgrid.com/totalcache/
* Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.
* Version: 2.1.8.2
* Version: 2.1.8.3
* Requires at least: 3.8
* Requires PHP: 5.6
* Author: BoldGrid
Expand Down

0 comments on commit 38723fd

Please sign in to comment.