keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Removes .br files (Brotli-compressed static files like index.html.br) when cache is cleared #62

Closed picasticks closed 4 years ago

picasticks commented 4 years ago

This is a simple feature add to remove .br (Brotli-compressed) versions of cached pages, if they exist, whenever the cache is cleared. The same way the uncompressed html and .gz compressed files are removed.

This commit does not add Brotli compression/creation of .br files. It just removes them. The assumption is that these are being created some other way, outside the plugin (this is what I'm doing).

svenba commented 4 years ago

This adds an overhead to sites not using Brotli compressed docs. However, I'll keep this in mind if we add Brotli compression.

picasticks commented 4 years ago

Cool, I'll submit another pull request with an alternate approach in clear_home().

There's no PHP module for Brotli but the PECL http extension includes it.