Pergunta

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?

Foi útil?

Solução

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 }
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top