Feature request: Disable mod_deflate/mod_brotli
-
Hello there!
I noticed that whenever caching is enabled, the plugin unconditionally writes the following block to .htaccess:
<IfModule mod_filter.c> <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json application/xml application/rss+xml application/atom+xml image/svg+xml </IfModule> <IfModule mod_brotli.c> AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json application/xml application/rss+xml application/atom+xml image/svg+xml </IfModule> </IfModule>Looking at the source, this block is gated only by whether caching is enabled, with no setting to opt out.
In my case, the Apache vhost configuration already enables and configures mod_deflate and mod_brotli server-wide (I have other non-WordPress sites on the same server that also rely on this). This results in the same compression directives being declared twice – once at the vhost level, once in .htaccess.
I tested this with curl and confirmed it doesn’t cause any functional issue (single content-encoding header is returned, no double-compression), so this isn’t urgent. But it would be cleaner to have a way to disable this specific block, similar to how other cache-header behaviors can be toggled.
Feature request: Could a setting be added to let users disable just the mod_deflate/mod_brotli block in .htaccess, for cases where compression is already handled at the server/vhost level?
Thanks for considering it.
You must be logged in to reply to this topic.