Possible to add no-cache headers on the critical files on the server?

13 views
Skip to first unread message

philt

unread,
Feb 3, 2008, 6:20:23 PM2/3/08
to sage-devel
Hello,

I had many troubles getting the upgrade through a caching proxy on
which I've no control.
When running sage -upgrade, the proxy didn't let me getting the latest
versions, which made troubles with the critical files:
http://www.sagemath.org/packages/standard/list
http://www.sagemath.org/packages/standard/deps
http://www.sagemath.org/packages/standard/newest_version
http://www.sagemath.org/packages/standard/README
http://www.sagemath.org/packages/install

I could get around by providing manually the files and skipping the
download in local/bin/sage-update

But would it be possible to add some anti-caching headers to the
official sage server for those files?
It'd help a lot all people like me with a sage install behind caching
proxy.
Sth like:
Expires: Mon, 26 Jul 1997 05:00:00 GMT"
Cache-Control: no-store, no-cache, must-revalidate"
Cache-Control: post-check=0, pre-check=0", false
Pragma: no-cache

Phil

mabshoff

unread,
Feb 3, 2008, 11:39:29 PM2/3/08
to sage-devel


On Feb 4, 12:20 am, philt <phil-goo...@teuwen.org> wrote:
> Hello,
>
> I had many troubles getting the upgrade through a caching proxy on
> which I've no control.
> When running sage -upgrade, the proxy didn't let me getting the latest
> versions, which made troubles with the critical files:http://www.sagemath.org/packages/standard/listhttp://www.sagemath.org/packages/standard/depshttp://www.sagemath.org/packages/standard/newest_versionhttp://www.sagemath.org/packages/standard/READMEhttp://www.sagemath.org/packages/install
>
> I could get around by providing manually the files and skipping the
> download in local/bin/sage-update
>
> But would it be possible to add some anti-caching headers to the
> official sage server for those files?
> It'd help a lot all people like me with a sage install behind caching
> proxy.
> Sth like:
> Expires: Mon, 26 Jul 1997 05:00:00 GMT"
> Cache-Control: no-store, no-cache, must-revalidate"
> Cache-Control: post-check=0, pre-check=0", false
> Pragma: no-cache
>
> Phil

Hi Phil,

I made the issue #2044 in trac. Can you elaborate a little more where
those headers need to go? Googling the issue for 2 minutes didn't turn
up anything useful and I need to leave for the airport soon to go to
Sage Days 7 :)

Cheers,

Michael

philt

unread,
Feb 4, 2008, 10:20:24 AM2/4/08
to sage-devel
Hi Michael,

Apparently your server is an Apache so after googling myself I found
those pages:
http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html
http://httpd.apache.org/docs/2.0/mod/mod_expires.html
http://httpd.apache.org/docs/2.0/mod/mod_headers.html#header
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

So I guess having a .htaccess in packages/ with sth like that is good
enough
(be sure to have modules expire and headers and to allow .htaccess
files)
<FilesMatch "(list|deps|newest_version|README)$">
<IfModule mod_expires.c>
# any Expires Directives go here
ExpiresActive On
ExpiresDefault access
</IfModule>
<IfModule mod_headers.c>
# any Header directives go here
Header set Cache-Control "no-store, no-cache, must-revalidate, max-
age=0"
Header set Pragma "no-cache"
</IfModule>
</FilesMatch>

And same for ../install

To be tested with sth like:
wget -O /dev/null -S http://www.sagemath.org/packages/standard/list
to see the headers returned by the Apache server

PS: I've troubles updating sage-scripts because I modified sage-update
file to bypass this problem, I'll describe it in a separate email.

mabshoff

unread,
Feb 8, 2008, 4:32:52 PM2/8/08
to sage-devel


On Feb 4, 4:20 pm, philt <phil-goo...@teuwen.org> wrote:
> Hi Michael,

Hi Phil,

> Apparently your server is an Apache so after googling myself I found
> those pages:http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-cachin...http://httpd.apache.org/docs/2.0/mod/mod_expires.htmlhttp://httpd.apache.org/docs/2.0/mod/mod_headers.html#headerhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
>
> So I guess having a .htaccess in packages/ with sth like that is good
> enough
> (be sure to have modules expire and headers and to allow .htaccess
> files)
> <FilesMatch "(list|deps|newest_version|README)$">
> <IfModule mod_expires.c>
> # any Expires Directives go here
> ExpiresActive On
> ExpiresDefault access
> </IfModule>
> <IfModule mod_headers.c>
> # any Header directives go here
> Header set Cache-Control "no-store, no-cache, must-revalidate, max-
> age=0"
> Header set Pragma "no-cache"
> </IfModule>
> </FilesMatch>
>
> And same for ../install

thanks for doing the research, things have been busy at SD7, but I
have added your info to the trac ticket and will hopefully have time
to solve this soon. I have to work on the sagemath.org webserver
today, so hopefully it will be reolved easily.

> To be tested with sth like:
> wget -O /dev/null -Shttp://www.sagemath.org/packages/standard/list
> to see the headers returned by the Apache server
>
> PS: I've troubles updating sage-scripts because I modified sage-update
> file to bypass this problem, I'll describe it in a separate email.

ok, I hope you already did that.

Cheers,

Michael

philt

unread,
Feb 13, 2008, 4:54:36 AM2/13/08
to sage-devel
Hi Michael,

> I have to work on the sagemath.org webserver
> today, so hopefully it will be reolved easily.
Great! Thanks!

> > PS: I've troubles updating sage-scripts because I modified sage-update
> > file to bypass this problem, I'll describe it in a separate email.
> ok, I hope you already did that.

Well I did describe my problem but nobody replied, snif snif ;-(
http://groups.google.com/group/sage-devel/browse_thread/thread/d0eef7393c104c61

Phil
Reply all
Reply to author
Forward
0 new messages