Skip to content

dmlayton/http-cache-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-cache-proxy

WSGI middleware to add HTTP Caching usage

You can create a standalone deployable wsgi app, by wrapping a proxy app like so

from restkit.contrib.wsgi_proxy import Proxy
from redis.client import StrictRedis
from http_cache import RedisCache, CacheMiddleWare

proxy = Proxy(strip_script_name=True)
app = CacheMiddleWare(proxy, RedisCache(StrictRedis())

or if you just what to add http caching to your own app

from my_mod import my_app
from redis.client import StrictRedis
from http_cache import RedisCache, CacheMiddleWare

app = CacheMiddleWare(my_app, RedisCache(StrictRedis())

You can also use your own cache (just define get and set)

from my_mod import my_app, MyCache
from redis.client import StrictRedis
from http_cache import CacheMiddleWare

app = CacheMiddleWare(my_app, MyCache())

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages