• Resolved jornalosaopaulo

    (@jornalosaopaulo)


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Poonam Namdev

    (@poonam9)

    Hi @jornalosaopaulo,

    Thanks for taking the time to report this.

    We understand the use case here: if compression is already managed globally at the server or vhost level, having the plugin also add mod_deflate / mod_brotli rules to .htaccess can be unnecessary and make the configuration noisier.

    We’ve registered this as a feature request so the team can consider adding an opt-out mechanism for those compression directives, most likely via a filter or a similar advanced option, while keeping the current default behavior unchanged for most users.

    We appreciate the suggestion.

    Thread Starter jornalosaopaulo

    (@jornalosaopaulo)

    Hi, @poonam9,

    Thanks for considering it!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.