platform/<version>/apps.json is served uncompressed

Open
#1,900 0 comments 0 reactions 1 assignee View on GitHub

@miaulalala is already working on this.

Since Sep 17, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement feature: api

AppsView carries @method_decorator(gzip_page, name="dispatch") (nextcloudappstore/api/v1/views.py:110) but the versioned listing served at platform/<version>/apps.json never has, so the single largest endpoint in the API is the one shipped uncompressed. It is also the one every Nextcloud instance fetches: lib/private/App/AppStore/Fetcher/AppFetcher.php in nextcloud/server points at it.

Measured against production on 2026-09-17, with Accept-Encoding: gzip sent and no content-encoding in the response: 30.0.0 is 10.9 MB, 31.0.0 11.3 MB, 32.0.0 14.7 MB, 33.0.0 12.3 MB. Gzipping the real 31.0.0 body gives 4.6 MB, so roughly 6.7 MB per response is avoidable — only on a cache miss, since conditional requests already answer 304 correctly in well under a second.

Proposed fixes, cheapest first:

  • Add @method_decorator(gzip_page, name="dispatch") to the view behind the app route, matching AppsView. One line, no behaviour change.
  • Or compress at the edge instead: responses carry via: 1.1 Caddy, so enabling encode for application/json there fixes every endpoint at once and keeps compression out of the application. Pick one, not both.
  • While looking: AppApiAppsView, CategoryView, NextcloudReleaseView, DiscoverView and AppRatingView have no gzip_page either. AppsView is currently the only view in the module that does, which suggests it was added to one endpoint reactively rather than as a policy.
  • Worth deciding explicitly whether compression belongs in the app or at the proxy, and writing that down, so the next large endpoint does not repeat this.

Note the compression ratio is only about 2.5x rather than the usual 8-10x for JSON, because much of the payload is base64 signatures and certificates.

Dominant language
Python
Stars
392
Forks
177
Avg merge
1d 2h
Merged PRs (30d)
29

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/appstore

All issues in nextcloud/appstore

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.