Skip to content

Count downloads from content delivery networks via a redirection scheme - #1525

Draft
LaurentRDC wants to merge 1 commit into
haskell:masterfrom
LaurentRDC:cache-count-via-redierct
Draft

LaurentRDC wants to merge 1 commit into
haskell:masterfrom
LaurentRDC:cache-count-via-redierct

Conversation

@LaurentRDC

Copy link
Copy Markdown
Contributor

This patch addresses the issue whereby tarball downloads served by a content delivery network were not counted in statistics.

The patch implements a redirect scheme, where requests to the main host now return a HTTP302 redirect response, with a Cache-Control: No-Store header, and counts the download. Then, the request is redirected to the user-content host for the download, which can be served either by Hackage itself or by some other cache.

This will result in more traffic to Hackage due to the cache policy on the redirection. The download count feature has been optimized in #1518, so I expect minimal actual load from this change.

Fixes #1517.

This patch addresses the issue whereby tarball downloads served
by a content delivery network were not counted in statistics.

The patch implements a redirect scheme, where requests to the main
host now return a HTTP302 redirect response, with a
Cache-Control: No-Store header, and counts the download. Then, the
request is redirected to the user-content host for the download,
which can be served either by Hackage itself or by some other cache.

This will result in /more/ traffic to Hackage due to the cache
policy on the redirection. The download count feature has been
optimized in haskell#1518, so I expect minimal actual load from this change.

Fixes haskell#1517.
@LaurentRDC
LaurentRDC requested a review from gbaz October 6, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Count downloads from content delivery network

1 participant