Permit caching of certain pages

10 views
Skip to first unread message

Alex Black

unread,
Jan 8, 2010, 3:28:36 PM1/8/10
to Lift
It looks like Lift sets response headers to prohibit caching of
responses. I have some pages I need to permit the browser to cache,
whats the best way to go about that?

Can I overwrite/change the response headers? I don't see a method to
do this on S, I do see S.getHeaders?

Thanks!

- ALex

David Pollak

unread,
Jan 8, 2010, 4:00:02 PM1/8/10
to lif...@googlegroups.com
On Fri, Jan 8, 2010 at 12:28 PM, Alex Black <al...@alexblack.ca> wrote:
It looks like Lift sets response headers to prohibit caching of
responses.  I have some pages I need to permit the browser to cache,
whats the best way to go about that?

Open a ticket and we'll add the feature. ;-)
 

Can I overwrite/change the response headers? I don't see a method to
do this on S, I do see S.getHeaders?

Thanks!

- 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
Surf the harmonics

Alex Black

unread,
Jan 8, 2010, 4:50:59 PM1/8/10
to Lift
I got something working like this:

LiftRules.defaultHeaders = {
// Permit caching of our home page
case (_, Req(List("index"),_,_)) =>
List("Cache-Control" -> "private, max-age=10800, pre-
check=10800",
"Pragma" -> "private",
"Expires" -> getExpiresDate)
case _ =>
List("Expires" -> "Mon, 26 Jul 1997 05:00:00 GMT",
"Cache-Control" ->
"no-cache; private; no-store; must-revalidate;
max-stale=0; post-check=0; pre-check=0; max-age=0",
"Pragma" -> "no-cache")
}*/

thoughts?

On Jan 8, 4:00 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote:


> On Fri, Jan 8, 2010 at 12:28 PM, Alex Black <a...@alexblack.ca> wrote:
> > It looks like Lift sets response headers to prohibit caching of
> > responses.  I have some pages I need to permit the browser to cache,
> > whats the best way to go about that?
>
> Open a ticket and we'll add the feature. ;-)
>
>
>
>
>
> > Can I overwrite/change the response headers? I don't see a method to
> > do this on S, I do see S.getHeaders?
>
> > Thanks!
>
> > - 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<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

Reply all
Reply to author
Forward
0 new messages