haskell / haskell/hackage-server

Count downloads from content delivery network

Open
#1,517 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
467
Forks
225
PR merge metrics
No merged PRs in 30d

Description

[Following my comment here](https://github.com/haskell/hackage-server/issues/1342#issuecomment-5280844764), we can get reliable download counts despite the existence of a CDN via a redirection scheme:

* [Add the Cache-Control: no-store](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control) header for the download endpoint;
* Log the download statistic.
* Return HTTP302 (Redirect) to another endpoint with the current CDN caching configuration.

I am happy to implement this feature.

One point that is unclear is whether this issue should be address _after_ https://github.com/haskell/hackage-server/issues/1342, given that the server will necessarily process more download counts.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the download endpoint and the linked discussion in issue #1342, then verify how the current CDN caching configuration is applied. Confirm how to add Cache-Control: no-store, record the download statistic, and return an HTTP 302 to the CDN-backed endpoint. Done means reliable counts without disrupting CDN delivery, with the dependency on issue #1342 resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.