mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Add caching for gzipped response
This commit is contained in:
parent
d56d5f5a20
commit
784362b532
1 changed files with 2 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
import gzip
|
import gzip
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
from functools import lru_cache
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ ap.use_backend(back)
|
||||||
MY_PERSON = ap.Person(**ME)
|
MY_PERSON = ap.Person(**ME)
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache(512)
|
||||||
def build_resp(resp):
|
def build_resp(resp):
|
||||||
"""Encode the response to gzip if supported by the client."""
|
"""Encode the response to gzip if supported by the client."""
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
Loading…
Reference in a new issue