Repository navigation
docs(server): serve precompressed theme assets, enable HTTP/2, minify JavaScript when needed - #90
Open
pierrebaguet wants to merge 2 commits into
Open
pierrebaguet wants to merge 2 commits into
pierrebaguet wants to merge 2 commits into
Conversation
…fy JavaScript when needed
This was referenced Oct 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Flexy and default-twig themes now write precompressed copies of their assets when they are compiled for production. The server pages did not say how to serve them, and nothing in the documentation mentioned HTTP/2, which matters for a theme that loads one JavaScript file per module.
What
In
docs/(Next): the published 3.2 version stays as it is until the theme and core releases ship this.getting-started/nginx-configuration.md: alocation ^~ /assets/block withgzip_static,brotli_static(ngx_brotli) andtry_files $uri =404, which is needed because both directives serve a compressed file without checking that its original exists. It extends the block of the CDN page instead of adding a second one. New sections on HTTP/2, on the precompressed formats and how to restrict them, and on minifying JavaScript withsensiolabs/minify-bundle, with the gain measured on the demo (about 7 KB on the home page, 10 KB on a product page, after Brotli).getting-started/apache-configuration.md: the rulespublic/.htaccesscarries from 3.3, for an older file or a virtual host without.htaccess, and why they are ignored in a<Directory>block while the.htaccessis read. HTTP/2 withmod_http2.getting-started/cdn.md: points to the nginx block, and the compile pitfall now mentions the minified stylesheet and the copies.upgrading/update.md: compile the assets in production after an update.Core pull request: thelia/thelia#4228. Theme pull requests: thelia-templates/flexy#312, thelia-templates/default-twig#154.
Tests
npm run buildpasses, with no broken link in these pages. The Apache rules were run on Apache 2.4.69: placed in the.htaccessthey serve the copies with the right headers; placed in<Directory>while the.htaccessis read, they are ignored. The nginx block was checked on nginx 1.26 with the brotli module, with a fallback toindex.phpinstead of=404so that the development server keeps working.