Bug 2350 - Webserver uses no-cache for everything (caching repo content is not possible)
: Webserver uses no-cache for everything (caching repo content is not possible)
Status: RESOLVED FIXED
Product: maemo.org Website
Repositories
: 4.0
: All Linux
: High normal (vote)
: ---
Assigned To: Marcell Lengyel
: downloads@maemo.org
: http://repository.maemo.org
:
:
:
  Show dependency tree
 
Reported: 2007-11-22 15:03 UTC by Aleksandr Koltsoff
Modified: 2008-07-25 10:51 UTC (History)
0 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Aleksandr Koltsoff (reporter) 2007-11-22 15:03:31 UTC
STEPS TO REPRODUCE THE PROBLEM:

As an example, a single deb is downloaded from the repo (http_proxy set to
local squid):

wget -S
http://repository.maemo.org/pool/maemo4.0/free/j/jade/jade_1.2.1-47osso1_i386.deb
--14:56:28-- 
http://repository.maemo.org/pool/maemo4.0/free/j/jade/jade_1.2.1-47osso1_i386.deb
           => `jade_1.2.1-47osso1_i386.deb'
Resolving proxy... 192.168.1.4
Connecting to proxy|192.168.1.4|:8080... connected.
Proxy request sent, awaiting response...
  HTTP/1.0 200 OK
  Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 mod_perl/1.29
  Content-Length: 326522
  Last-Modified: Thu, 08 Nov 2007 15:27:07 GMT
  Content-Type: application/x-debian-package
  X-Pad: avoid browser bug
  Expires: Thu, 22 Nov 2007 12:56:34 GMT
  Cache-Control: max-age=0, no-cache
  Pragma: no-cache
  Date: Thu, 22 Nov 2007 12:56:34 GMT
  X-Cache: MISS from blart.intranet
  X-Cache-Lookup: MISS from blart.intranet:8080
  Proxy-Connection: close
Length: 326,522 (319K) [application/x-debian-package]

100%[========================================>] 326,522       11.56K/s    ETA
00:00

14:56:59 (13.08 KB/s) - `jade_1.2.1-47osso1_i386.deb' saved [326522/326522]

----------------

Note these two lines:
  Cache-Control: max-age=0, no-cache
  Pragma: no-cache

This effectively stops any HTTP compliant proxy from caching any files from
that server.

I.e., these things shouldn't really even happen. Come on people.


EXPECTED OUTCOME:

Caching is not disabled for files that change unfrequently and are large. apt
is intelligent enough to use cache-bypass for Packages files.

ACTUAL OUTCOME:

Local cache is bypassed each time.

REPRODUCIBILITY:
(always/sometimes/once)

Always

OTHER COMMENTS:

Argh.
Comment 1 Marcell Lengyel maemo.org 2008-03-06 12:41:41 UTC
All things under repository.maemo.org should come through Akamai, so first it
has to be investigated who sets the no-cache tags.
Comment 2 Marcell Lengyel maemo.org 2008-05-07 14:08:14 UTC
It seems that the orgin server was not sending any cache-control headers, and
Akamai inserted the no-cache things below. I have changed the configuration on
the origin side slightly, it will set a "Cache-Control: must-revalidate,
max-age=432000, public" for .deb packages. It will take some time while this
propagates to all Akamai cache servers.
Comment 3 Marcell Lengyel maemo.org 2008-07-22 11:59:14 UTC
With the origin server it works fine. I have to check why Akamai insists on
no-cache...

wget -S
http://stage.maemo.org/pool/maemo4.0/free/j/jade/jade_1.2.1-47osso1_i386.deb
--11:57:28-- 
http://stage.maemo.org/pool/maemo4.0/free/j/jade/jade_1.2.1-47osso1_i386.deb
           => `jade_1.2.1-47osso1_i386.deb.1'
Connecting to 172.16.42.133:8080... connected.
Proxy request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Tue, 22 Jul 2008 09:04:12 GMT
  Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 mod_perl/1.29
  Last-Modified: Thu, 08 Nov 2007 15:27:07 GMT
  Cache-Control: must-revalidate, max-age=432000, public
  Content-Type: application/x-debian-package
  Content-length: 326522
  Connection: close
  Age: 0
Length: 326,522 (319K) [application/x-debian-package]

100%[============================================================================>]
326,522      973.95K/s

11:57:28 (973.80 KB/s) - `jade_1.2.1-47osso1_i386.deb.1' saved [326522/326522]
Comment 4 Marcell Lengyel maemo.org 2008-07-25 10:51:47 UTC
The configuration was changed on the cache provider side. Now the origin
cache-control headers are honoured.

marcell@test:~$ wget -S --no-proxy --no-cache --delete-after
http://repository.maemo.org/pool/maemo4.0/free/j/jade/jade_1.2.1-47osso1_i386.deb
--10:44:44-- 
http://repository.maemo.org/pool/maemo4.0/free/j/jade/jade_1.2.1-47osso1_i386.deb
           => `jade_1.2.1-47osso1_i386.deb'
Resolving repository.maemo.org... 217.212.246.67, 217.212.246.59
Connecting to repository.maemo.org|217.212.246.67|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.0 200 OK
  Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-18 mod_perl/1.29
  Content-Length: 326522
  Last-Modified: Thu, 08 Nov 2007 15:27:07 GMT
  Content-Type: application/x-debian-package
  Cache-Control: public, must-revalidate, max-age=359133
  Date: Fri, 25 Jul 2008 07:44:45 GMT
  Connection: keep-alive
Length: 326,522 (319K) [application/x-debian-package]

Feel free to reopen/create a new bug report/contact me directly if the cache
control headers still need some fine tuning (now set only for .deb files).