[Catalog-sig] Pypi cdn for hosted packages
M.-A. Lemburg
mal at egenix.com
Thu Feb 28 15:28:47 CET 2013
On 28.02.2013 15:02, M.-A. Lemburg wrote:
> On 28.02.2013 14:37, Giovanni Bajo wrote:
>> Il giorno 28/feb/2013, alle ore 13:53, Donald Stufft <donald.stufft at gmail.com> ha scritto:
>>
>>> On Thursday, February 28, 2013 at 7:49 AM, M.-A. Lemburg wrote:
>>>> There you go:
>>>>
>>>> https://d1t66zoqn9vlte.cloudfront.net/simple/
>>> Same thing on Fastly http://pypi.python.org.a.prod.fastly.net/simple/
>>>
>>> Easy :)
>>
>> Given that /simple doesn't expose HTTP cache headers, you're not basically using the CDN for that URL:
>>
>> $ http HEAD https://pypi.python.org/simple/
>> HTTP/1.1 200 OK
>> Content-Length: 240286
>> Content-Type: text/html; charset=utf-8
>> Content-encoding: gzip
>> Date: Thu, 28 Feb 2013 13:04:26 GMT
>> Server: nginx/1.1.19
>> Strict-Transport-Security: max-age=86400
>>
>> So it's not that easy. Plus, neither of them are SSL.
>
> CloudFront uses SSL:
>
> https://d1t66zoqn9vlte.cloudfront.net/simple/
>
> and the default cache retention is 24h if no cache headers
> are provided.
>
> These are the headers provided by CloudFront, first request:
>
> 200 OK
> Content-Type: text/html; charset=utf-8
> Content-Length: 1323539
> Connection: keep-alive
> Server: nginx/1.1.19
> Date: Thu, 28 Feb 2013 13:56:22 GMT
> Strict-Transport-Security: max-age=86400
> X-Amz-Cf-Id: vXAxMoustlCxyzFAVjjg3EUJG5OgP-ALefiF1mbvbJlW9ZsHCxtdLg==
> Via: 1.0 3dee24f419c49cc32df542a9410fda87.cloudfront.net (CloudFront)
> X-Cache: Miss from cloudfront
>
> Second request:
>
> 200 OK
> Content-Type: text/html; charset=utf-8
> Content-Length: 1323539
> Connection: keep-alive
> Server: nginx/1.1.19
> Date: Thu, 28 Feb 2013 13:56:22 GMT
> Strict-Transport-Security: max-age=86400
> Age: 337
> X-Amz-Cf-Id: -2COLjgkKLDF83jrr0iFahyAO4UGOMB0hXNM_ROMFJQpII1goFyi-A==
> Via: 1.0 3dee24f419c49cc32df542a9410fda87.cloudfront.net (CloudFront)
> X-Cache: Hit from cloudfront
>
>> I don't see this need to rush. Let's not redo the mistake of the HTTP redirect that broke everything. Even if it takes two weeks with proper testing and integration with the CDN provider, I think it's more than fast enough.
>
> The above setups are for testing, and not meant for deployment.
Just for the archives:
I've now setup CF to not provide content via HTTP, use HTTPS
for fetching data from PyPI, use "pypi" as root object, use
a default retention of 3600 seconds (better for testing, for
deployment, a higher value may be better - this can be customized
on a per path basis).
The changes should be visible by now.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Feb 28 2013)
>>> Python Projects, Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
More information about the Catalog-SIG
mailing list