This is pretty much what rails does. Straight from github:

<link 
href="/stylesheets/bundle_common.css?7371c81fbc6b010a32fb11b42a0fc322c3c57863" 
media="screen" rel="stylesheet" type="text/css" />
<link 
href="/stylesheets/bundle_github.css?7371c81fbc6b010a32fb11b42a0fc322c3c57863" 
media="screen" rel="stylesheet" type="text/css" />

It would be nice to provide some kind of generic helper snippet for this. Some 
hash that is configured on boot up would be great; provide some function in 
lift rules to alter the behaviour and away we go. Perhaps something like:

<lift:css href="/whatever.css"  />

Thoughts?

Cheers, Tim


On 12 Feb 2010, at 18:53, Jeppe Nejsum Madsen wrote:

> On Fri, Feb 12, 2010 at 7:28 PM, Marius <marius.dan...@gmail.com> wrote:
>> Oh yes I did and I hate it. Ironically I was about to propose a
>> solution for this.
>> 
>> instead of
>> 
>> <link rel="stylesheet" type="text/css" href="mycss.css"/>
>> 
>> do something like:
>> 
>> <lift:css name="mycss.css" />
>> 
>> this would render:
>> 
>> <link rel="stylesheet" type="text/css" href="mycss.css?
>> i784yrfiuhferfhweir57=_"/>
>> 
>> the query string parameter would be generated at application start-up.
>> If you update you css/js and restart the application the browser will
>> refresh it. Potentially generating the random query string param could
>> be a LiftRules function that by default generates a sequence once per
>> application time. Thus you could potentially set your own function
>> that reads this for a config file?
>> 
>> Similarly <lift:js name="myjs.js"/> would do the same.
> 
> I had similar thoughts sometime ago, but haven't looked at it since then:
> 
> http://groups.google.com/group/liftweb/browse_thread/thread/1130ce4f9d5af010/a36c52fde3b2bc5b?lnk=gst&q=jeppe++cache&pli=1
> 
> For me, the real benefit would be combining many requests into one and
> setting a future "Expires" date but still be sure that all artifacts
> will be updated correctly.
> 
> /Jeppe
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
> 
> 

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

Reply via email to