-
Notifications
You must be signed in to change notification settings - Fork 15
How Does Catnap Work?
Catnap works at the view / response rendering layer of your application by forcing your chosen web framework's view rendering to delegate to Catnap, intercepting the returned object models, evaluating them against the query supplied in the URL, and serializing the fields that result from the evaluation of the query.
Catnap does not modify your returned response objects so your internal caching strategy does not need to be changed. You can return full resource representations to Catnap, from cache, and Catnap will modify the response according to the query when it serializes the response to the wire.
Response Rendering Steps:
-
The web framework (Spring, RESTEasy, or Jersey) receives a response to render.
-
The web framework calls a Catnap view renderer that supports the requester's desired content type. The manner in which this call is made depends on the web framework.
-
The Catnap View Renderer calls query parsers to parse the Catnap query expression in the URL.
-
The Catnap query processor maps the parsed query expression to properties on the response object.
-
The Catnap Model Builder walks the response object model and selects fields that match the query expression; building a map of the object as it goes.
-
The Catnap View renders the object map built by the Model Builder to the wire.