sensiolabs/SensioFrameworkExtraBundle — pull request #238 by fabpot (2013-09-05 14:45:38+00:00)
Title: First steps towards 3.0 ... or expression everywhere ;)

The 3.0 version of this bundle will be the first one to not be aligned with the released of Symfony itself.

That said, the major changes provided by this PR are support for the new @Security annotation and the HTTP validation headers support in the @Cache annotation:

```php
/**
* @Route("/post/{id}")
* @Cache(smaxage="15", lastModified="post.getUpdatedAt()", ETag="'Post' ~ post.getId() ~ post.getUpdatedAt()")
* @Security("has_role('ROLE_ADMIN')")
*/
public function showAction(Post $post)
{
}
```

As you can see, the `lastModified` and `Etag` attributes of the `@Cache` annotation allows the developer to define an expression that must be used to set the `Last-Modified` and the `ETag` headers. In addition, it automatically takes care of the 304 management (which frees you from copy/pasting the same boiler-plate code over and over).

The `@Security` annotation takes an expression like the ones supported by the access control rules. It performs better that the access control rules as it is only executed when the route matches.