Skip to content

precompress static files - #8557

Closed
Zoey2936 wants to merge 1 commit into
mainfrom
precompressed
Closed

Zoey2936 wants to merge 1 commit into
mainfrom
precompressed

Conversation

@Zoey2936

@Zoey2936 Zoey2936 commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The PR was tested and verified that it works locally
  • Sign-off message is added to all commits
  • Tests (playwright if possible) are included
  • Screenshots before/after for front-end changes
  • Documentation has been updated or is not required
  • Labels added where applicable (ex: bug/enhancement, 3. to review, feature component)
  • Milestone next added

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

After making some size comparisons, the results speak for brotli, it is the smallest when compressing nextcloud and the support in browser is perfect since many many years. So zstd (a little bit bigger on the highest level compared to brotlis highest level and not supported in older browsers) and gzip (bad compression) are not needed.

But I must correct myself in one important point: integrity checks break...
I see two options how this could be fixed:

  1. compressed files are saved in a diffrent folder and apache rewrites to this folder if brotli is used, works fine, but skips the check for all precompressed files so they could be modified without the check noticing it
  2. resign all files again after compressing them with a selfsigned key

I think option 2 is the best

@Zoey2936
Zoey2936 requested review from pabzm and szaimen and a balanced review from Copilot August 8, 2026 19:09

This comment was marked as off-topic.

Signed-off-by: Zoey <zoey@z0ey.de>
@szaimen szaimen added 2. developing Work in progress enhancement New feature or request labels Aug 15, 2026
@szaimen

szaimen commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

After making some size comparisons, the results speak for brotli, it is the smallest when compressing nextcloud and the support in browser is perfect since many many years. So zstd (a little bit bigger on the highest level compared to brotlis highest level and not supported in older browsers) and gzip (bad compression) are not needed.

But I must correct myself in one important point: integrity checks break... I see two options how this could be fixed:

  1. compressed files are saved in a diffrent folder and apache rewrites to this folder if brotli is used, works fine, but skips the check for all precompressed files so they could be modified without the check noticing it
  2. resign all files again after compressing them with a selfsigned key

Honestly, I'd favour Nextcloud Zip archive shipping the already compressed files.

Can you please create a FR for this here? https://github.com/nextcloud/server/issues

Thanks in advance! :)

@Zoey2936

Copy link
Copy Markdown
Collaborator Author

see nextcloud/server#63324

@Zoey2936 Zoey2936 closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants