Optimize web assets

Last updated Apr 24, 2026 Unoptimized HTML, CSS, and JavaScript increase page weight and slow down rendering. Cloudflare Speed automatically minifies and compresses these assets, while Zaraz loads third-party analytics and marketing tags server-side to avoid blocking page rendering.

Solutions

Speed

Improve the performance of your website or web application. Learn more about Speed.

  • Minification - Remove whitespace and unnecessary characters from HTML, CSS, and JavaScript automatically
  • Compression - Brotli and Gzip compression applied to all text-based assets at the edge
  • Core Web Vitals - Improve Largest Contentful Paint (LCP), Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS) scores by deferring non-critical scripts and optimizing asset delivery

Zaraz

Server-side loading of third-party tools to improve performance and privacy. Learn more about Zaraz.

  • Third-party optimization - Load analytics, marketing tags, and other third-party tools through Cloudflare without blocking page rendering

Get started

  1. Enable Speed optimizations
  2. Zaraz get started

Was this helpful?

YesNo

On this page

Optimize web assets - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/use-cases/performance/web-assets/#page","headline":"Optimize web assets","description":"Speed up page rendering by minifying HTML, CSS, and JavaScript and loading third-party scripts server-side.","url":"https://developers.cloudflare.com/use-cases/performance/web-assets/","inLanguage":"en","image":"https://developers.cloudflare.com/use-cases/performance/web-assets/og.png?v=0d8ec5f170d00dd9","dateModified":"2026-04-24","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Secure employees, devices, and data with Cloudflare Zero Trust access, secure web gateway, email security, and data loss prevention. title: Company security image: https://developers.cloudflare.com/use-cases/company-security/og.png?v=90418726911ce63e


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/use-cases/llms.txt
Use this file to discover all available pages before exploring further.