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

The reliable way to improve a PageSpeed score with Nginx is to measure first, change only the delivery settings that match a failing Lighthouse audit, and measure again. Nginx can reduce transferred text, reuse safe responses, and serve static files more efficiently. It cannot compensate for oversized images, render-blocking application code, third-party scripts, or slow work in your backend.

This guide shows where Nginx helps, gives configuration patterns you can adapt, and explains the safety checks required before enabling compression, caching, static-file optimizations, or the optional ngx_pagespeed module.

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

Start with a PageSpeed or Lighthouse audit

PageSpeed work is an audit-and-measurement loop, not a search for one magic Nginx directive. Lighthouse documentation describes the process plainly: you provide a URL, Lighthouse runs a series of audits, and it generates a report. The report contains opportunities and diagnostics that identify the work most likely to improve the measured page.

Run the page through PageSpeed Insights or Lighthouse before editing Nginx. Record the URL, device profile, test time, performance score, Core Web Vitals status, and the individual audits that failed. A PageSpeed Insights result can include both Lighthouse lab data and real-world Chrome UX Report data; those measurements answer different questions and will not necessarily move together after one server change.

#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:Upgraded 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.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Interpret the score as a band, not a promise

Lighthouse classifies scores as 0–49 Poor, 50–89 Needs Improvement, and 90–100 Good. Chrome for Developers also notes that a score of 100 is extremely challenging and is not an expected universal target. A small score change is less useful than a clear improvement in the audit or metric that was limiting the page.

Create a repeatable baseline

  1. Run the same URL with the same mobile or desktop setting and, where possible, the same test location.
  2. Save the report or record its failing audits, transfer sizes, and diagnostic warnings.
  3. Change one material Nginx behavior at a time, or group changes that must be deployed together.
  4. Re-run the audit after the configuration is active and compare the relevant audit, not only the overall score.
  5. Check server logs and application behavior as well as the browser report; a faster response that serves stale or private data is not a successful optimization.

Match the failing audit to the Nginx lever

Nginx affects the path between an origin application or file and the browser. The table below separates the main levers by what they change and by the risks you must control.

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.
Approach What it changes Typical benefit Main cost or safety boundary
Runtime gzip Wire bytes for compressible text responses Smaller HTML, CSS, JavaScript, JSON, XML, and SVG transfers CPU work on the server; only compress suitable response types
Proxy cache Whether a response is fetched from the origin again Lower origin work and faster repeat delivery for reusable responses Disk, cache invalidation, and a risk of sharing personalized or authenticated content
sendfile and tcp_nopush The kernel and socket path used for static files Fewer copies and more efficient packet delivery for files Applies to static delivery; it does not optimize application rendering
try_files How Nginx resolves an incoming path Serves an existing file directly and sends misses to an explicit fallback Incorrect ordering or fallback rules can route valid files to the application
ngx_pagespeed Generated or rewritten page resources Potential automatic resource optimization when the module is compatible and correctly cached Additional module, cache, build, and maintenance complexity

Choose a lever only when the audit and your response data support it. Nginx cannot make an image smaller when the image itself is oversized or poorly encoded, and it cannot remove JavaScript that blocks rendering in the application.

Compress text responses selectively with gzip

Compression often reduces the size of transmitted text. Nginx documents a pattern built from gzip on, a list of MIME types in gzip_types, an optional gzip_proxied policy, and a gzip_min_length threshold. The settings can be placed in http, server, or location context, so choose the narrowest context that matches your policy.

A conservative configuration pattern

gzip on;
gzip_types text/plain text/css application/javascript application/json application/xml image/svg+xml;
gzip_min_length 1000;
gzip_proxied no-cache no-store private expired auth;

This example enables compression for common text and SVG responses, while avoiding the overhead of compressing very small responses. The proxy rule tells Nginx when it may compress responses received from an upstream server. Adapt the MIME list to the content your application actually emits; do not assume that every response labelled as text is safe or worthwhile to compress.

Understand the trade-off

Runtime compression consumes CPU. On a busy server, compressing every response can move the bottleneck from network transfer to request processing. Compare response size and timing with CPU, load, and error measurements after enabling it. If a response is already compressed or is a binary asset, adding it to gzip_types usually adds work without reducing useful bytes.

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.
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

Use precompressed files when your build creates them

gzip_static on; makes Nginx look for a matching .gz file and serve that precompressed representation. It does not perform runtime compression. This can shift compression work to the build process, but it requires the compressed files to exist beside the originals and to be replaced whenever the source asset changes. Confirm that deployment and cache invalidation publish both representations consistently.

Verify what the browser receives

After reloading the configuration, inspect a representative HTML, CSS, JavaScript, JSON, and SVG response in browser developer tools or your HTTP inspection method. Confirm that the response is compressed only where intended, that the content type is correct, and that a response is not being compressed twice by another proxy. Then re-run the specific Lighthouse opportunity associated with transfer size.

Cache only responses that are safe to share

Proxy caching can prevent Nginx from contacting the origin for every request for the same reusable response. The official Nginx guide describes disk caching for responses and notes that, when proxy caching is enabled, GET and HEAD responses are cached by default in Nginx Plus. The performance gain is meaningful only when the cached representation is correct for every client that can receive it.

Place the cache storage in the http context

Define the cache zone with proxy_cache_path in http, then enable that zone in the relevant server or location. One documented pattern is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
http {
    proxy_cache_path /data/nginx/cache keys_zone=mycache:10m max_size=1g inactive=60m;

    server {
        location / {
            proxy_cache mycache;
            proxy_cache_valid 200 302 10m;
            proxy_cache_valid 404 1m;
            proxy_cache_bypass $cookie_nocache $arg_nocache;
            proxy_no_cache $http_pragma $http_authorization;
            proxy_pass http://backend;
        }
    }
}

The values in this example are policy choices, not universal defaults. keys_zone=mycache:10m allocates memory for cache keys and metadata, max_size=1g limits the cache size, and inactive=60m removes entries that have not been used during that period. The validity rules give successful and redirected responses a ten-minute lifetime and not-found responses a one-minute lifetime.

Protect personalized and authenticated content

Do not copy the example unchanged for account pages, shopping carts, dashboards, responses that vary by cookie, or frequently changing content. A shared cache can serve one user’s representation to another user if the cache key and bypass policy do not distinguish them. The example bypasses caching when a nocache cookie or query argument is present and suppresses storage when the upstream request carries a Pragma or Authorization header. Your application may need additional rules for cookies, authorization, response headers, or explicit purge events.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【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.

Choose freshness and invalidation deliberately

A long validity period reduces origin work but increases the time a changed page can remain available from cache. A short period reduces staleness at the cost of more origin requests. Set different policies for stable public assets, ordinary HTML, error responses, and content that changes frequently. Document how an editor or deployment invalidates entries; without an invalidation plan, a faster page can still show old content.

Measure cache behavior separately from browser performance

Inspect whether a test request is a cache hit, miss, or bypass according to your logging and response headers. Test both an anonymous request and a request carrying the cookies or credentials used by real users. A Lighthouse run that happens to be a cache hit does not prove that the first visit is fast, and a cache hit for private data is a correctness failure rather than a performance win.

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

Make static-file delivery efficient

For files that Nginx serves directly, sendfile on; avoids copying file data into an intermediate buffer. The F5 Nginx documentation describes this as direct copying from one file descriptor to another. tcp_nopush on; can work with sendfile so headers are sent in one packet, reducing avoidable packetization for static responses.

sendfile on;
tcp_nopush on;

location / {
    try_files $uri $uri/ @backend;
}

Resolve files before invoking the application

try_files checks for files and directories using the request URI and routes a miss to the named @backend location. This lets Nginx serve an existing stylesheet, script, image, or other file without sending the request through application routing. Define the named location explicitly in your full configuration and make sure its upstream behavior is correct.

Keep the fallback explicit

The order of the try_files arguments matters. A directory match can be useful for an index request, while a miss should go to the intended backend rather than an accidental default server. Test existing files, directory URLs, application routes, and genuinely missing paths after changing this rule. Static delivery settings cannot improve a file that is not present, and they do not reduce the bytes in that file.

Consider ngx_pagespeed only as an optional module

The ngx_pagespeed project documents enabling the module with pagespeed on;, configuring a writable pagespeed FileCachePath, and using location handlers for optimized resources. It also shows verifying module output with an X-Page-Speed response header.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Check operational fit before production

  • Confirm that the module is compatible with the exact Nginx build, operating system, and deployment process you operate.
  • Verify the provenance and maintenance status of the module package or build; do not assume that a distribution package has the same features as a separately built module.
  • Provide a writable file-cache path with enough capacity and a retention or cleanup policy.
  • Check how rewritten resource URLs interact with your browser cache, proxy cache, content security policy, and deployment invalidation.
  • Compare the generated output with the original page and keep a fast rollback path.

Use the response header as a diagnostic signal, not as proof of a better score. The module changes generated resources and introduces another cache to reason about. If a Lighthouse audit is failing because the origin sends too many bytes, first establish whether ordinary gzip, safe response caching, or correct static routing addresses the measured problem with less operational complexity.

Fix the problems Nginx cannot solve

Server configuration is only one part of the critical rendering path. Google’s image guidance emphasizes choosing an appropriate format, quality, resolution, and responsive delivery for each asset and device because images often account for a large share of downloaded bytes. Nginx can transfer an image efficiently, but it cannot choose a better source image for a phone or repair an image that was exported at an unnecessarily high resolution.

  • Images: resize and encode assets for their actual display dimensions, provide device-appropriate variants, and remove files that the page never uses.
  • Application code: reduce render-blocking CSS and JavaScript, defer work that is not needed for initial rendering, and remove unused code in the build pipeline.
  • Third-party scripts: audit tags, widgets, and embeds that add requests or main-thread work; Nginx cannot control the implementation or availability of an external service.
  • Backend latency: profile database queries, templates, API calls, and upstream dependencies when the initial response is slow. A proxy cache may hide repeated work for public pages, but it does not make an uncached personalized request faster.

Use the Lighthouse audit to decide which of these belongs in the next work item. Do not enable every Nginx feature simply because it is available.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A deployment workflow that limits regressions

1. Capture the baseline

Record the current score, Core Web Vitals results, failing audits, response sizes, and whether the test was a first request or a repeat request. Keep a copy of the active Nginx configuration and note the build or package version that is running.

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

2. Select one bounded change

Choose compression for a transfer-size opportunity, caching for repeated public origin work, static delivery for file-serving overhead, or an application-side fix for a rendering or image audit. Write down the safety boundary before editing: public versus private, static versus generated, and anonymous versus authenticated.

3. Validate configuration before reload

Check directive context, file paths, upstream names, and permissions. Ensure that a cache directory exists and is writable where required, and that a Pagespeed file cache cannot grow without control. Use your normal Nginx configuration test and controlled reload procedure rather than editing a live file without validation.

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.

4. Test representative requests

  • Anonymous HTML request, first visit and repeat visit.
  • Authenticated or cookie-bearing request, if the site has one.
  • Existing static file, directory URL, application route, and missing URL.
  • Compressed and uncompressed response types listed in your policy.
  • Freshly changed content, to verify cache invalidation and versioning.

5. Re-run the same audit

Use the same URL, device profile, and testing conditions. Compare the audit that motivated the change, transfer sizes, and timing. A score increase without an improvement in the relevant audit may reflect normal test variation rather than a durable configuration benefit.

6. Watch production signals

Review CPU usage after enabling runtime gzip, disk usage and hit or miss behavior after enabling proxy caching, and error rates after changing routing. For generated resources, check cache growth and whether clients receive current URLs after a deployment. Keep the previous configuration available for rollback until the change has survived normal traffic.

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

Troubleshoot common outcomes

The score does not move after enabling gzip

Check whether the failing audit concerns images, third-party code, render-blocking resources, or backend time. Confirm that the response MIME type appears in gzip_types, that the response exceeds gzip_min_length, and that another proxy has not already compressed it. If the page is dominated by images or application work, smaller text transfers may not change the measured bottleneck.

CPU rises after compression

Runtime gzip trades CPU for fewer wire bytes. Narrow the MIME list, raise the minimum length, or use build-time precompressed files with gzip_static on; where your deployment can reliably publish matching .gz files. Re-test transfer size and server load together; a lower network cost is not useful if it causes origin saturation.

Cached pages are stale or show the wrong user’s data

Disable the affected cache location while investigating. Review cache keys, cookies, authorization headers, bypass conditions, no-cache conditions, validity periods, and purge behavior. Personalization and authentication require a deliberate non-cache path or a cache design that separates representations safely.

Static routes stop reaching the application

Inspect the try_files order and the named backend location. Confirm the requested file exists where Nginx expects it, directory handling is intentional, and the fallback is not catching valid files or routing misses to an unintended server. Test both a known asset and a dynamic route after every routing change.

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

ngx_pagespeed output behaves inconsistently

Check module and Nginx build compatibility, write permissions for pagespeed FileCachePath, generated-resource URLs, and interactions with other caches. Verify the X-Page-Speed header while diagnosing, then compare the actual generated response and Lighthouse audit. Remove or disable the module if its cache behavior or maintenance burden is greater than the measured benefit.

Use a decision checklist before you publish a change

  • Is there a specific Lighthouse or PageSpeed audit this change addresses?
  • Does the setting affect wire bytes, origin work, file transfer, or generated resources?
  • Could the response contain authentication, cookies, or user-specific data?
  • Have CPU, disk, cache invalidation, and rollback costs been identified?
  • Were existing files, dynamic routes, errors, and personalized requests tested?
  • Was the same audit repeated after deployment, with production monitoring still in place?

Nginx configuration is most effective when it removes a measured delivery bottleneck without crossing a data-safety boundary. Treat compression, caching, static delivery, and ngx_pagespeed as separate tools, select the smallest change that fits the failing audit, and keep image, application, third-party, and backend work in the plans where those problems actually live.

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.