feldroy / feldroy/air

FEAT: Cache TTL for app.page decorator

Open
#401 11 comments 0 reactions 1 assignee Claimed by @aybruhm View on GitHub
python
Dominant language
Python
Stars
917
Forks
98
PR merge metrics
No merged PRs in 30d

Description

**Describe the feature**

In a lot of cases the content for `app.page` is static enough that we should provide a cache option for it. For example, a landing page may get updated never, or once per hour. Being able to specify the length of the cache in seconds would be really useful and allow easy performance boosts for a site. It would be good to have this API as a feature:

```python
import air

app = air.Air()

@app.page(cache_ttl=3600) # 1 hour cache
def index():
return air.layouts.mvpcss(
air.H1('Welcome!'),
... # Large page structure here
)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.