Jaymon / endpoints

Lightweight REST api backend framework that automatically maps urls to python modules and classes
MIT License
29 stars 10 forks source link

add http cache decorator #19

Closed Jaymon closed 9 years ago

Jaymon commented 9 years ago

basically, the decorator should take a ttl and then set the appropriate headers: Cache-Control, Pragma, and Expires.

Likewise, there should be a nocache decorator that makes the page uncacheable:

"Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache", 
"Expires": "0"
Jaymon commented 9 years ago

I've added a nocache decorator but not a more full featured decorator that would set the cache headers to configurable values.

Jaymon commented 9 years ago

I added a @httpcache(ttl) at some point and never closed this issue :(