There were two build issues on GHC 7.4: using atomicModifyIORef'
and ByteString.Lazy.toStrict, both of which were missing. These
are now fixed.
In addition, looking at the IORef code more closely,
we want the quite a bit of strictness in the IORef.
The common case is that the widget content already exists in the map
(every reload of a page will call embedStaticContent), but until we
force the map the thunks holding the duplicated generated content will
be kept around, leaking memory. This will be the common situation since
the vast majority of the time the content already exists. Since
the containers module does not have a strict map until 0.5, use
unordered containers which does have a strict map.
This commit adds just the subsite itself. The subsite
works by running a list of generaters at compile time.
The entries produced by the generators are converted into
wai-app-static.WaiAppStatic.Storage.Embedded entries. Also,
addStaticContent is supported via an IORef. When a widget
produces static content (css, javascript), it is stuck into
the IORef inside the embedded static subsite. The embedded
static subsite will then serve it from the IORef, properly
using a 304 response if the client already has the content.