Domanda

I am looking for something like cacheSeconds for the subsite generated by Yesod.Static in order to control caching of static resources. Is it possible?

È stato utile?

Soluzione

Yes. Yesod.Static is just a Yesod wrapper around wai-app-static, which is a general purpose WAI static file server. You want to set the ssMaxAge setting. Depending on exactly what your code looks like now, this could be something along the lines of:

Static settings <- static "/some/static/path"
let newStatic = Static $ settings { ssMaxAge = NoMaxAge }
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top