Skip to content

Instantly share code, notes, and snippets.

@esses
Created August 21, 2012 18:12
Show Gist options
  • Save esses/3418021 to your computer and use it in GitHub Desktop.
Save esses/3418021 to your computer and use it in GitHub Desktop.
Learned LiftWeb Tricks

Skip Lift Processing

For /static/page-skips-lift.html, the following code in Boot.scala skips Lift processing and defers to tomcat/jetty/whatever for a truly static file. This also allows you to avoid loading of liftAjax.js on a per page basis.

    case Req("static" :: "page-skips-lift" :: Nil, "html", _) => false
}```

### Resource ID For Asset Caching

Like Ruby on Rails, Lift will generate a hash to allow for browser caching of resources. You must explicitly tell lift to do this for your resources with the lift class 'with-resource-id'.

```<link class="lift:with-resource-id" href="/css/reset.css" media="all" rel="stylesheet" type="text/css"/>```

### Tail Tag

... Google Analytics Code, etc, etc ```

Surrounding markup with the tail tag will place content to the bottom of the generated HTML right before the closing tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment