Skip to content

Commit

Permalink
Faster Register README update
Browse files Browse the repository at this point in the history
  • Loading branch information
danadesrosiers committed Apr 23, 2018
1 parent edbee57 commit ccc4904
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ annot.cache
-----------
An instance of a class that implements Doctrine\Common\Cache\Cache. This is the cache that will be used by the AnnotationReader to cache annotations so they don't have to be parsed every time. Make sure to include Doctrine Cache as it is not a required dependency of this project.

annot.base_uri (Enables Faster Controller Registration)
--------------
This is the base uri of all requests. Basically, it's the part of the URI that isn't included in `$_SERVER['REQUEST_URI']`. If your bootstrap file is at the root of htdocs, the value is "/". If your bootstrap file lives in a directory called "api", all your API's URIs are prefixed with "/api" and that is value you must specify for annot.uri.

annot.base_uri enables faster registration of controllers. Silex has to register every endpoint in your app on every request. If you have a lot of endpoints, that could be a significant overhead on each and every request. Silex Annotations can improve this by filtering the controllers that need to be registered using the `prefix` on the `Controller` annotation. We only need to register the endpoints in the Controller if the prefix matches the URI. In this way, Silex Annotations allows FASTER routing than pure Silex.

Annotate Controllers
====================
Create your controller. The following is an example demonstrating the use of annotations to register an endpoint.
Expand Down

0 comments on commit ccc4904

Please sign in to comment.