Remove "expires" header

298 views
Skip to first unread message

Alex Black

unread,
Nov 22, 2010, 1:39:18 PM11/22/10
to Lift
Whats the best way to remove the "expires" header for certain pages?

I've tried this:

LiftRules.defaultHeaders = {
case _ =>
Nil
}

But Firebug reports getting these headers:

Expires Thu, 01 Jan 1970 00:00:00 GMT
X-Lift-Version 2.1
Set-Cookie
ssid=09342663-1c38-4b18-9781-1137a2ae54e2;Path=/;Expires=Tue, 22-
Nov-11 18:36:58 GMT
Content-Type text/html
Content-Length 31448
Server Jetty(6.1.14)

I'd like to omit the Expires headers in certain circumstances.

thx

- Alex

Alex Black

unread,
Nov 22, 2010, 1:45:27 PM11/22/10
to Lift
I see LiftRules.overwrittenReponseHeaders and
LiftRules.supplimentalHeaders (spelt incorrectly), would either of
these help?

David Pollak

unread,
Nov 22, 2010, 3:13:40 PM11/22/10
to lif...@googlegroups.com
It's changed in LiftRules.defaultHeaders

I'm looking into where the expires header is inserted, but I'm suspecting it's Jetty.

With the defaultHeaders set to return Nil, Lift sets the following headers in the servlet response:

setting header Content-Type to application/xhtml+xml; charset=utf-8
setting header Content-Length to 2981
setting header X-Lift-Version to 2.2-SNAPSHOT

I think it's Jetty that's inserting the "0" expires header.


LiftRules.overwrittenReponseHeaders -- indicates that setHeader (rather than addHeader) should be used for headers that should only have 1 entry ("Expires by default")
LiftRules.supplimentalHeaders -- add headers to the response.  By default, inserts the X-Lift-Version header

 

thx

- Alex

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Alex Black

unread,
Nov 23, 2010, 12:30:02 PM11/23/10
to Lift
Ah, ok, thanks. I'll look into whether or not Jetty can be configured
to omit the expires header.

On Nov 22, 3:13 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

David Pollak

unread,
Nov 23, 2010, 12:32:20 PM11/23/10
to lif...@googlegroups.com
On Tue, Nov 23, 2010 at 9:30 AM, Alex Black <al...@alexblack.ca> wrote:
Ah, ok, thanks. I'll look into whether or not Jetty can be configured
to omit the expires header.

And if there's anything that Lift is doing to poke Jetty the wrong way, please open a ticket and I'll work on it.
 
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages