haskell - Customizing repsonse headers in Wai middleware -
i'm using wai-middleware-static serve custom pages server. however, saw server getting requests favicon.ico
, etc. on every page load, , every single 1 of web fonts, decided check cache settings on response headers , found there none.
wai-middleware-static returns middleware
value, think callback function provided middleware run on every request. there way modify add in response header tell browser cache result?
multiple middlewares can chained normal function composition, e.g.:
middleware1 . middleware2
so if had middleware added cache settings response, should set. basic structure may is:
addcachesettings :: middleware addcachesettings innerapp request = innerresponse <- innerapp request return $ myhelper innerresponse myhelper :: response -> response myhelper = error "your logic here"
Comments
Post a Comment