Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Enable Brotli at the web-server layer, not in the Linux kernel or your application code. On NGINX, install a Brotli filter module, load it, turn on brotli, and restrict additional MIME types with brotli_types. On Apache 2.4.26 or later, load mod_brotli and attach its BROTLI_COMPRESS filter to text responses. Validate the configuration, reload the service, and verify that a request advertising Accept-Encoding: br receives Content-Encoding: br.

What Brotli compression does on a VPS

Brotli is a lossless compression format designed for web delivery. The server compresses eligible response bytes before sending them, and a browser that supports Brotli decompresses them transparently. Smaller transfers can reduce bandwidth use and improve transfer time for text-heavy resources such as HTML, CSS, JavaScript, JSON, XML, and SVG.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compression is negotiated per request. A client advertises supported encodings in the Accept-Encoding request header; the server chooses an acceptable representation and identifies it with Content-Encoding. Shared caches must distinguish compressed and uncompressed variants, which is why Vary: Accept-Encoding is important when a response may be cached for different clients.

Brotli is not useful for every file. JPEG, PNG, GIF, video, ZIP, and similar formats are already compressed, so recompressing them wastes CPU and can occasionally make the payload larger. Start with text responses and static assets, then broaden coverage only after observing CPU use, cache behavior, and application security.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Check your VPS before changing configuration

Identify the server and distribution

Use the service you actually run. NGINX directives do not work in Apache configuration files, and Apache filters do not work in NGINX. Check the running processes or your hosting image documentation, then identify the distribution family so you can install a compatible module package.

  • Debian and Ubuntu commonly use apt and systemd service names such as nginx or apache2.
  • RHEL-family distributions commonly use dnf or yum and an httpd service.
  • Confirm that you have root or sudo access and a maintenance window for a configuration reload or restart.

Make a recoverable change

Back up the relevant virtual-host and main configuration files before editing. Keep an existing SSH session open while testing so a syntax error cannot lock you out of the VPS. If the server is managed by a control panel, use its supported module mechanism rather than replacing packages by hand.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand module availability

Brotli support is supplied by a web-server module. A distribution may package it separately, compile it into a custom build, or omit it from its standard repository. The package name and module path therefore depend on the distribution and the NGINX or Apache build you installed.

Enable Brotli in NGINX

1. Install a module compatible with your NGINX build

Install a Brotli package that matches the NGINX ABI and repository channel used by your VPS. For NGINX Plus on Debian or Ubuntu, the documented package command is:

sudo apt update
sudo apt install nginx-plus-module-brotli

RHEL-family systems use the equivalent package manager command, for example sudo dnf install or sudo yum install, with the Brotli module package supplied by the repository for your NGINX edition. Do not copy a module built for a different NGINX version; an ABI mismatch can prevent NGINX from starting.

2. Load the dynamic modules

Open the main nginx.conf file and put module-loading directives in the main context, before the http block. The filter module is required for on-the-fly compression. The static module is needed only if you intend to serve files that were pre-compressed during deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
load_module modules/ngx_http_brotli_filter_module.so;
load_module modules/ngx_http_brotli_static_module.so;

If your package installs the shared objects in a different directory, use the exact path shown by that package. If you are not serving pre-compressed files, omit the static-module line rather than loading an unnecessary component.

3. Turn on filtering and choose MIME types

Inside the http, server, or location context, enable Brotli and list the additional response types you want compressed:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
brotli on;
brotli_types text/plain text/css application/javascript application/json application/xml image/svg+xml;

The Google-maintained ngx_brotli documentation states that text/html is always compressed and that brotli_types adds MIME types. The list above therefore covers common text formats without applying compression indiscriminately. Ensure your application sends the MIME types you expect; a mislabelled response may not match the list.

Place the directives at the narrowest scope that matches your policy. Putting them in http applies the policy to all virtual hosts unless a more specific block overrides it. A server or location block is safer when you need to test one site first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Optionally serve pre-compressed files

If your build pipeline creates files such as app.js.br beside app.js, enable static lookup:

brotli_static on;

Use this only when matching .br files are reliably generated, deployed, and kept in sync with the originals. Static delivery avoids recompressing the same immutable asset on every request. It does not create the files for you, and it should not be enabled on a directory where stale or incomplete .br files could be mistaken for current assets.

5. Validate and reload without stopping NGINX

Run the syntax test before applying the change:

sudo nginx -t

A successful test reports that the syntax is OK and the test is successful. If it reports an unknown directive, the module was not loaded, the module path is wrong, or the installed module is incompatible with the running NGINX binary. Fix that error before reloading.

After a successful test, reload the configuration:

sudo nginx -s reload

A reload allows existing workers to finish current requests while new workers use the new configuration. Check the service log immediately afterward for module-load, permission, or configuration errors.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable Brotli in Apache

1. Confirm Apache version and load mod_brotli

Apache HTTP Server 2.4.26 and later provide mod_brotli. On Debian- or Ubuntu-based systems, the usual workflow is to install the distribution’s Brotli module package and enable the module with the platform’s module helper, for example:

sudo apt update
sudo apt install libapache2-mod-brotli
sudo a2enmod brotli

Package names and helper commands vary on RHEL-family systems; use the module package built for your Apache version. Confirm that Apache can load the module before adding directives. A failed module load will make a restart fail rather than silently disabling compression.

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

2. Compress selected text responses

The safest starting point is an explicit MIME-type list in the virtual host or directory configuration:

AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json

This attaches Apache’s BROTLI_COMPRESS output filter to the listed response types. Add a type only when your application really emits that type and the payload is not already compressed by another format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Apply the filter more broadly only with exclusions

Apache also documents a broad filter form:

SetOutputFilter BROTLI_COMPRESS
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-brotli

The broad form can affect responses you did not intend to compress, so exclusions are essential. Extend the exclusion policy for other pre-compressed formats used by your site, such as archives or media containers. An explicit MIME list is easier to audit when you have a mixed application.

4. Restart or gracefully reload Apache

Validate the configuration with the command appropriate to your distribution, then perform a graceful reload or restart through systemd. For example, Debian and Ubuntu commonly use:

sudo apache2ctl configtest
sudo systemctl reload apache2

RHEL-family installations commonly use httpd instead of apache2. Watch the error log after the reload for an unknown filter, a missing module, or a directive placed in a context where it is not permitted.

Dynamic compression versus pre-compressed assets

When dynamic compression is appropriate

Dynamic compression is convenient for generated HTML, API responses, and content that changes frequently. The server produces the Brotli representation when the request arrives, so no separate build artifact is required. The trade-off is CPU work on every cache miss or request that reaches the compressor. Under sustained load, compression can compete with application workers and TLS processing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to pre-compress

Pre-compression is especially effective for versioned CSS, JavaScript, SVG, and other immutable assets. A deployment step creates the .br file once; the web server then serves it without recompressing the source on each request. Apache’s documentation notes that mod_brotli recompresses content for each request and that pre-compressing can provide a performance benefit.

Pre-compressed delivery must preserve the HTTP metadata. The response for the Brotli variant needs Content-Encoding: br, and a shared cache needs Vary: Accept-Encoding so it does not give a Brotli-only representation to a client that did not advertise support. Test both the compressed and fallback paths after every deployment.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Verify that the VPS returns Brotli

1. Request a compressible resource with Brotli negotiation

Use a real text asset or endpoint and advertise Brotli explicitly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -I -H 'Accept-Encoding: br' https://example.com/asset.css

For a compressible response, look for Content-Encoding: br. Also look for Vary: Accept-Encoding when the response can be stored by a shared proxy or CDN. A missing Content-Encoding can mean the resource is not in your configured MIME list, the module is not loaded, the request bypassed the intended virtual host, or the server selected another encoding.

2. Test a client that does not advertise Brotli

curl -I -H 'Accept-Encoding: gzip' https://example.com/asset.css

The server should return an uncompressed representation or an encoding supported by that request. It must not return Content-Encoding: br solely because a .br file exists on disk.

3. Test the actual body when headers are ambiguous

Some applications or proxies treat HEAD requests differently from GET requests. Repeat the test with a GET and discard the body if necessary:

curl -sS -D - -o /dev/null -H 'Accept-Encoding: br' https://example.com/asset.css

Inspect the response from the public hostname, not only a loopback request, because a reverse proxy, CDN, or load balancer may add or remove encoding headers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Check logs and cache layers

After reloading, inspect the web-server error log for module or syntax failures and the access log for the request you tested. If the origin returns Brotli but the public endpoint does not, inspect proxy and CDN compression policies, cache keys, and header rewriting. Purge an old cached representation before repeating the test.

NGINX and Apache: which configuration model fits?

Decision point NGINX Apache
Module availability Install a Brotli module compatible with the NGINX build; NGINX Plus documents the nginx-plus-module-brotli package. Apache 2.4.26 and later provide mod_brotli; distribution package names vary.
Enablement Load the filter shared object with load_module; load the static shared object only for pre-compressed files. Load mod_brotli, then attach the BROTLI_COMPRESS output filter.
MIME control brotli on plus brotli_types; HTML is always included by the Google module documentation. AddOutputFilterByType BROTLI_COMPRESS for an explicit list, or SetOutputFilter with exclusions.
Pre-compressed assets brotli_static on serves matching .br files generated during deployment. Configure the static-file path and headers so the served variant has Content-Encoding: br and cache variation on Accept-Encoding.
Apply the change Run nginx -t, then nginx -s reload. Run the platform’s Apache config test, then gracefully reload or restart the service.
Operational risk Dynamic compression consumes worker CPU; static serving reduces repeated work. mod_brotli recompresses on requests unless pre-compressed content is served.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

CPU, caching, and rollout decisions

Watch resource usage

Brotli compression is server-side work. Monitor CPU load, request latency, worker saturation, and response sizes after enabling it. There is no universal compression ratio or latency percentage: results depend on the content, compression quality settings, CPU, cache hit rate, and whether the response was generated or served from disk. A setting that is harmless on a static-asset host may be expensive on a busy API server.

Roll out in stages

  1. Enable Brotli for static text assets or a single virtual host.
  2. Verify negotiation, fallback behavior, and cache headers from an external client.
  3. Observe CPU, error rates, and origin response time during normal and peak traffic.
  4. Expand the MIME list or additional virtual hosts only when the measurements remain acceptable.

Keep cache variants correct

A cache key that ignores Accept-Encoding can mix Brotli and non-Brotli responses. Ensure the origin or proxy emits Vary: Accept-Encoding for negotiated responses and that any CDN honors it. When deploying immutable assets, use a new filename or cache-busting version so an old uncompressed object cannot mask the new representation.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Security: understand the BREACH-family risk

Compression over TLS can create an information-disclosure risk for some applications. The BREACH family of attacks exploits changes in compressed length when attacker-controlled input is combined with secrets in a reflected response. Apache’s documentation warns that some web applications are vulnerable when a TLS connection carries compressed data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not treat Brotli as a security feature. Review pages that reflect query parameters, form fields, or other attacker-controlled text alongside CSRF tokens, session identifiers, or other secrets. A conservative rollout starts with public, non-sensitive static assets and ordinary text responses. For sensitive dynamic pages, consider disabling compression, separating secrets from reflected content, using per-request tokens carefully, and applying the mitigations recommended by your application framework and security team.

Troubleshoot common failures

unknown directive "brotli" in NGINX

The filter module is not loaded, its shared object path is wrong, or the module does not match the NGINX binary. Confirm the package installation, check the file path, place load_module in the main context, and rerun nginx -t. Do not bypass the error by deleting the directive if Brotli is required; install a compatible module instead.

NGINX reload fails after adding load_module

Check the exact error from nginx -t. Typical causes are a typo in the module filename, a module built for another NGINX release, duplicate loading, or insufficient permission to read the shared object. Restore the backup configuration if you need to recover service quickly, then correct one issue at a time.

Apache reports an unknown filter

BROTLI_COMPRESS is available only after mod_brotli loads successfully. Verify the module package, enablement command, and Apache error log. Ensure the directive is in a permitted virtual-host, directory, or server context for your installation.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The response is never encoded as Brotli

Confirm that the client sent Accept-Encoding: br, that the response MIME type matches the configured list, and that no upstream proxy removed the header. Check whether the response is already compressed, marked with a no-transform policy, or excluded by a location, environment variable, or application rule. Test a known static CSS or JavaScript file to separate server configuration from application behavior.

Brotli is served to an unsupported client

Inspect the request and response headers at the public endpoint. A static-file rule that serves .br without checking negotiation is incorrect. Ensure the server chooses the pre-compressed variant only when the client advertises Brotli and sends the corresponding Vary: Accept-Encoding response header.

CPU usage rises after enabling compression

Reduce the scope to static assets and selected text MIME types, avoid compressing already compressed formats, and move frequently requested immutable files to a pre-compression workflow. Compare origin CPU and cache-hit behavior before expanding coverage again.

A practical enablement checklist

  • Identify whether the VPS uses NGINX or Apache and record its version and distribution.
  • Install a module package built for that exact server family and version.
  • Back up the current configuration and keep an SSH recovery session open.
  • Enable only text-like MIME types first; exclude images, archives, and media.
  • Use NGINX brotli_static or an Apache pre-compression arrangement only when deployment creates valid, current .br files.
  • Validate syntax before reloading or restarting.
  • Verify both Brotli negotiation and a non-Brotli fallback with curl.
  • Check Content-Encoding, Vary, logs, cache behavior, CPU, and latency.
  • Review TLS responses for BREACH-family exposure before compressing sensitive dynamic pages.

Bottom line

For NGINX, the reliable sequence is install a compatible module, load the filter (and static module only when needed), set brotli on and a narrow brotli_types list, then run nginx -t and nginx -s reload. For Apache 2.4.26 or newer, load mod_brotli and use AddOutputFilterByType BROTLI_COMPRESS for selected text responses. In both cases, verify headers from the public endpoint, preserve cache variation on Accept-Encoding, and expand beyond static text only after CPU, caching, and BREACH risks have been evaluated.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.