problem with Expires

10 views
Skip to first unread message

pioc

unread,
Nov 8, 2010, 5:35:28 AM11/8/10
to CirruxCache
Hi, i have a problem with Expires Headers.

On my site, i have a js file http://www.calendriergratuit.fr
My expires header for this file is :
http://www.calendriergratuit.fr/calendrier.js

HTTP/1.1 200 OK
Set-Cookie: 90plan=R3938678685; path=/; expires=Wed, 10-Nov-2010
22:35:15 GMT
Date: Mon, 08 Nov 2010 10:24:52 GMT
Server: Apache/2.2.X (OVH)
Last-Modified: Wed, 03 Nov 2010 21:14:46 GMT
Accept-Ranges: bytes
Cache-Control: max-age=31536000
Expires: Tue, 08 Nov 2011 10:24:52 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 12457
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/javascript
----------------------------------------------------------

Expires is set to 08 Nov 2011 ====> GOOD

With Cirruxcache, on my cdn http://cdnpioc2.appspot.com/calendrier.js,
My expires header for this file is :
HTTP/1.1 200 OK
Set-Cookie: 90plan=R4264011811; path=/; expires=Wed, 10-Nov-2010
22:11:43 GMT
Accept-Ranges: bytes
Vary: Accept-Encoding,User-Agent
Cache-Control: max-age=31536000
Content-Type: application/javascript
Last-Modified: Wed, 03 Nov 2010 21:14:46 GMT
Expires: Mon, 08 Nov 2010 10:23:29 GMT
Content-Encoding: gzip
X-AppEngine-Estimated-CPM-US-Dollars: $0.002548
X-AppEngine-Resource-Usage: ms=28 cpu_ms=44 api_cpu_ms=0
Date: Mon, 08 Nov 2010 10:23:29 GMT
Server: Google Frontend
Content-Length: 12455
----------------------------------------------------------

Expires is set to 08 Nov 2010 ====> BAD

So i have a problem for caching files

My pop is :

origin = 'http://www.calendriergratuit.fr'
maxTTL = 31536000
ignoreQueryString = True
forceTTL:31536000

Is it a configuration problem???

In YSlow, I have Add Expires Headers with F score

Thanks

Samuel Alba

unread,
Nov 10, 2010, 11:13:31 AM11/10/10
to cirru...@googlegroups.com
Hi,

sorry for the delay. Yes, I think it is a config problem, because
CirruxCache sets the Expires header with value of 'now + max-age'.

Could you attach your whole configuration (privately if you prefers)?

Thanks,

- Sam

> --
> Project page: http://code.google.com/p/cirruxcache/
> News: http://www.shad.cc/tag/cirruxcache
> Groups: http://groups.google.com/group/cirruxcache
>

--
Samuel Alba

pioc

unread,
Nov 11, 2010, 4:22:28 PM11/11/10
to CirruxCache
i reply privately, have you the configuration?

On Nov 10, 5:13 pm, Samuel Alba <sam.a...@gmail.com> wrote:
> Hi,
>
> sorry for the delay. Yes, I think it is a config problem, because
> CirruxCache sets the Expires header with value of 'now + max-age'.
>
> Could you attach your whole configuration (privately if you prefers)?
>
> Thanks,
>
> - Sam
>
>
>
>
>
>
>
>
>
> On Mon, Nov 8, 2010 at 11:35 AM, pioc <julien.darri...@gmail.com> wrote:
> > Hi, i have a problem with Expires Headers.
>
> > On my site, i have a js filehttp://www.calendriergratuit.fr
> > My expires header for this file is :
> >http://www.calendriergratuit.fr/calendrier.js
>
> > HTTP/1.1 200 OK
> > Set-Cookie: 90plan=R3938678685; path=/; expires=Wed, 10-Nov-2010
> > 22:35:15 GMT
> > Date: Mon, 08 Nov 2010 10:24:52 GMT
> > Server: Apache/2.2.X (OVH)
> > Last-Modified: Wed, 03 Nov 2010 21:14:46 GMT
> > Accept-Ranges: bytes
> > Cache-Control: max-age=31536000
> > Expires: Tue, 08 Nov 2011 10:24:52 GMT
> > Vary: Accept-Encoding,User-Agent
> > Content-Encoding: gzip
> > Content-Length: 12457
> > Keep-Alive: timeout=5, max=100
> > Connection: Keep-Alive
> > Content-Type: application/javascript
> > ----------------------------------------------------------
>
> > Expires is set to 08 Nov 2011 ====> GOOD
>
> > With Cirruxcache, on my cdnhttp://cdnpioc2.appspot.com/calendrier.js,

pioc

unread,
Nov 11, 2010, 4:23:26 PM11/11/10
to CirruxCache
the config.py file :

# CirruxCache provides dynamic HTTP caching on AppEngine (CDN like)
# Copyright (C) 2009 Samuel Alba <sam....@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
#

"""CirruxCache configuration file
"""

from lib import cache, redirect, forward, image
urls = {}


# EDIT BELOW

urls['default'] = (
#'(/debug/.*)', 'Debug',
'(/.*(?:\.jpg|css|js|gif|png|pdf|ico))$', 'config.Static'
)

# POP definition
# You can define and configure your Point Of Presence

class Static(cache.Service):
origin = 'http://www.calendriergratuit.fr'
allowFlushFrom = ['127.0.0.1']
maxTTL = 31104000
forceTTL = 31104000
ignoreQueryString = True




On Nov 10, 5:13 pm, Samuel Alba <sam.a...@gmail.com> wrote:
> Hi,
>
> sorry for the delay. Yes, I think it is a config problem, because
> CirruxCache sets the Expires header with value of 'now + max-age'.
>
> Could you attach your whole configuration (privately if you prefers)?
>
> Thanks,
>
> - Sam
>
>
>
>
>
>
>
>
>
> On Mon, Nov 8, 2010 at 11:35 AM, pioc <julien.darri...@gmail.com> wrote:
> > Hi, i have a problem with Expires Headers.
>
> > On my site, i have a js filehttp://www.calendriergratuit.fr
> > My expires header for this file is :
> >http://www.calendriergratuit.fr/calendrier.js
>
> > HTTP/1.1 200 OK
> > Set-Cookie: 90plan=R3938678685; path=/; expires=Wed, 10-Nov-2010
> > 22:35:15 GMT
> > Date: Mon, 08 Nov 2010 10:24:52 GMT
> > Server: Apache/2.2.X (OVH)
> > Last-Modified: Wed, 03 Nov 2010 21:14:46 GMT
> > Accept-Ranges: bytes
> > Cache-Control: max-age=31536000
> > Expires: Tue, 08 Nov 2011 10:24:52 GMT
> > Vary: Accept-Encoding,User-Agent
> > Content-Encoding: gzip
> > Content-Length: 12457
> > Keep-Alive: timeout=5, max=100
> > Connection: Keep-Alive
> > Content-Type: application/javascript
> > ----------------------------------------------------------
>
> > Expires is set to 08 Nov 2011 ====> GOOD
>
> > With Cirruxcache, on my cdnhttp://cdnpioc2.appspot.com/calendrier.js,

Samuel Alba

unread,
Nov 14, 2010, 5:15:36 AM11/14/10
to cirru...@googlegroups.com
Hi,

seeing your configuration, it should work as expected (with a bigger
Expires). Did you try to flush the object? Give me some time to deploy
the same config and try on my side.

- Sam

pioc

unread,
Nov 15, 2010, 2:12:57 AM11/15/10
to CirruxCache
yes i tryto flush but i have the same problem

On Nov 14, 11:15 am, Samuel Alba <sam.a...@gmail.com> wrote:
> Hi,
>
> seeing your configuration, it should work as expected (with a bigger
> Expires). Did you try to flush the object? Give me some time to deploy
> the same config and try on my side.
>
> - Sam
>
>
>
>
>
>
>
>
>
> On Thu, Nov 11, 2010 at 10:23 PM, pioc <julien.darri...@gmail.com> wrote:
> > the config.py file :
>
> > # CirruxCache provides dynamic HTTP caching on AppEngine (CDN like)
> > # Copyright (C) 2009 Samuel Alba <sam.a...@gmail.com>

Samuel Alba

unread,
Nov 15, 2010, 6:36:32 AM11/15/10
to cirru...@googlegroups.com
In your case, the Expires header is rewritten by the Google Frontend.
I made a simple test with the same value:

Expires: Mon, 15 Nov 2010 11:33:09 GMT
X-Debug: Thu, 10 Nov 2011 11:27:05 GMT

I need to figure out why this header is rewritten in your case, I've
never seen this before. Did someone get this behavior before?

I will get back to you as soon as I get something interesting about that.

Samuel Alba

unread,
Nov 15, 2010, 6:49:50 AM11/15/10
to cirru...@googlegroups.com
Ok I found a workaround. Cleanup your headers as following - add this
line to your existing config - as a new property of your Static
config:

headerBlacklist = ['x-google-cache-control', 'set-cookie', 'vary']

Then flush the object and tell me what do you have. Maybe I will add
this to the default config in a next release.

--
Samuel Alba

pioc

unread,
Nov 15, 2010, 8:14:05 AM11/15/10
to CirruxCache
I will try it this evening, i'm at work!
Thanks Sam for your response

On Nov 15, 12:49 pm, Samuel Alba <sam.a...@gmail.com> wrote:
> Ok I found a workaround. Cleanup your headers as following - add this
> line to your existing config - as a new property of your Static
> config:
>
> headerBlacklist = ['x-google-cache-control', 'set-cookie', 'vary']
>
> Then flush the object and tell me what do you have. Maybe I will add
> this to the default config in a next release.
>
>
>
>
>
>
>
>
>
> On Mon, Nov 15, 2010 at 12:36 PM, Samuel Alba <sam.a...@gmail.com> wrote:
> > In your case, the Expires header is rewritten by the Google Frontend.
> > I made a simple test with the same value:
>
> > Expires: Mon, 15 Nov 2010 11:33:09 GMT
> > X-Debug: Thu, 10 Nov 2011 11:27:05 GMT
>
> > I need to figure out why this header is rewritten in your case, I've
> > never seen this before. Did someone get this behavior before?
>
> > I will get back to you as soon as I get something interesting about that.
>

pioc

unread,
Nov 15, 2010, 2:22:07 PM11/15/10
to CirruxCache
Thank you sam, it's working!!!!
I flush the object and my Expires headers are correct!

I don't know why my header was rewritten by google frontend....

Samuel Alba

unread,
Nov 15, 2010, 3:39:06 PM11/15/10
to cirru...@googlegroups.com
I think the Google frontend rewrites Expires header when a
"Set-Cookie" is set in the response, to ensure the cookie won't be
cached. IMHO, this is not a bug, this behavior is logic. In
conclusion, to bypass this behavior, we only need to blacklist
explicitly the "set-cookie" header from origin (by the way, a cached
website has no reasons to set cookies).

pioc

unread,
Nov 16, 2010, 8:07:29 AM11/16/10
to CirruxCache
this cookie is from my host
Reply all
Reply to author
Forward
0 new messages