You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
-3Lines changed: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,6 @@ Also, Ellar took some concepts from [FastAPI](https://fastapi.tiangolo.com/){tar
25
25
The objective of Ellar is to provide a high level of abstracted interface to the web, along with a well-structured project setup, give room for object-oriented approach to web application design,
26
26
allow you chose your desired application architecture, and ultimately, deliver speedy handling to requests.
27
27
28
-
As developers, we never know how big a project can become or evolve over time but following some design patterns and architecture makes it easier to build a more testable and maintainable application.
Copy file name to clipboardExpand all lines: docs/techniques/caching.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -413,7 +413,8 @@ For example, lets make `CacheService` available in our route function.
413
413
414
414
415
415
## **Using Cache Decorator**
416
-
Ellar provides a cache decorator that can be used to cache the responses of route functions. The cache decorator can be applied to a route function to automatically cache its response data for a specified amount of time.
416
+
Ellar provides a cache decorator that can be used to cache the responses of route functions.
417
+
The cache decorator can be applied to a route function to automatically cache its response data for a specified amount of time.
417
418
418
419
The cache decorator takes the following arguments:
419
420
@@ -423,25 +424,30 @@ The cache decorator takes the following arguments:
423
424
-`backend` (optional): the name of the cache backend to use for storing the cached data. By default, the `default` cache backend is used.
424
425
-`make_key_callback` (optional): a callback function that can be used to generate a custom cache key. This function takes an `IExecutionContext` instance (which contains information about the request context) and key prefix, and should return the custom cache key to use.
425
426
427
+
!!! info
428
+
`Cache` Decorator can also be applied to any controller class.
429
+
When this is done, all the routes response of that controller will be cached
430
+
426
431
We can rewrite the above example using `cache` decorator:
0 commit comments