Response optimization
Minify website assets and optimize supported images.
Website options
Open Optimization for your website, enable the options you need, and save the configuration.
| Option | Behavior |
|---|---|
| CSS minification | Minifies CSS files, style blocks, and style attributes. |
| JavaScript minification | Minifies separate script files while preserving variable names. |
| HTML minification | Preserves comments, document tags, and inline scripts. Inline CSS follows the CSS option. |
| HTTPS Rewrites | Upgrades supported HTTP URLs for the website and its aliases. |
| Image optimization | Preserves PNG pixels and recompresses supported JPEG files at quality 85. |
Test representative pages before enabling an option across your website. Minification changes Subresource Integrity (SRI) hashes. CSS minification and HTTPS Rewrites can also affect inline Content Security Policy (CSP) hashes; update those hashes to match the transformed content.
Browser and edge caches
CSS, JavaScript, HTML, PNG, and JPEG responses require browser revalidation before reuse. This also applies when optimization is disabled or processing is skipped. Browser lifetime overrides cannot extend freshness for these response types.
Private and no-store restrictions still apply. Fonts and other asset types retain their configured browser lifetime.
The edge can still cache eligible responses using origin freshness. Saving body-optimization settings clears the website's edge cache.
Stylesheet versions
CSS minification adds a version to same-site stylesheet links, style preloads, and CSS imports. The version changes when body-optimization options or configured hostnames change.
The _loclix_opt query parameter is reserved for this purpose. Loclix removes it before forwarding to the origin; it does not change the origin cache key. Other query parameters and fragments are preserved.
New page loads request the current stylesheet version. Pages already open keep their loaded styles until navigation or reload. Version stylesheet URLs created by JavaScript in your application. External stylesheets and relative references under a foreign HTML base are unchanged.
Compatibility and limits
Body processing requires a complete successful GET response. Text must use UTF-8 or US-ASCII. The following responses pass through without body changes:
- Responses larger than 2 MiB, downloads, partial responses, and responses with trailers.
- Responses with
no-transforminstructions. - Event streams and explicitly incremental responses.
- Other flushed responses that do not complete within 100 milliseconds of the first flush.
Responses also pass through unchanged when optimization capacity is busy. Gzip responses keep gzip encoding. HTTPS rewrites and stylesheet version parameters can add bytes even when minification reduces the body.
These limits affect body processing; the browser revalidation rules above still apply.
See Cache for storage and purge behavior.