Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add project.last_serial to simple.detail and legacy.api.json routes #3429

Merged
merged 2 commits into from
Mar 26, 2018

Conversation

ewdurbin
Copy link
Member

This adds the project's latest serial to /simple/<project_name>/ and /pypi/<project_name>/json.

As Warehouse uses Fastly Soft Purges, we need to tweak the ETag in order to notify the CDN that the page has changed. Currently the CDN performs a conditional GET in order to decide if it needs to pull refreshed content, and since the contents of these pages don't change for maintainer and role updates it skips purging them.

This is primarily a concern for clients like bandersnatch which use the X-PyPI-Last-Serial header to determine if they're getting the latest goods.

This adds the project's latest serial to `/simple/<project_name>/` and `/pypi/<project_name>/json`.

As Warehouse uses Fastly Soft Purges, we need to tweak the ETag in order to notify the CDN that the page has changed. Currently the CDN performs a conditional GET in order to decide if it needs to pull refreshed content, and since the contents of these pages don't change for maintainer and role updates it skips purging them.

This is primarily a concern for clients like bandersnatch which use the X-PyPI-Last-Serial header to determine if they're getting the latest goods.
@ewdurbin ewdurbin requested a review from dstufft March 26, 2018 21:26
@@ -186,6 +186,7 @@ def json_release(release, request):
"bugtrack_url": project.bugtrack_url,
"home_page": release.home_page,
"download_url": release.download_url,
"last_serial": project.last_serial,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a top level key, it's not part of the release info.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d'oh

@ewdurbin ewdurbin merged commit 1941030 into master Mar 26, 2018
@ewdurbin ewdurbin deleted the last_serial branch March 26, 2018 23:02
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.

2 participants