[web-devel] JS caching

Mister Asafe Ribeiro asafe.hai.kai at gmail.com
Wed Jul 13 02:02:37 CEST 2011

Suppose I want to avoid caching of my js files. I did something like that:

script ! type_ "text/javascript" $ getScripts [my,editJS]


my = "document.write('<script type=\"text/javascript\" src=\"/js/my.js?' +
new Date().getTime() + '\" ><\\/script>');"
booksJS = "document.write('<script type=\"text/javascript\"
src=\"/js/books.js?' + new Date().getTime() + '\" ><\\/script>');"

getScripts scripts =preEscapedString $ foldl1 (++) scripts

Although I load the scripts, it seems I'm not avoid anything at all. What is
the better (or right way) to do that (with Happstack and blaze-html)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110712/e9ef3d8f/attachment.htm>

More information about the web-devel mailing list