Use strict version of readFile in filesystem cache backend

Portnov [2009-07-02 13:49:43]
Use strict version of readFile in filesystem cache backend
Filename
Blog/Blog
Blog/Blog.hs
Blog/static/index.html
Framework/Cache.hs
diff --git a/Blog/Blog b/Blog/Blog
index c3266a6..477f542 100755
Binary files a/Blog/Blog and b/Blog/Blog differ
diff --git a/Blog/Blog.hs b/Blog/Blog.hs
index c558a93..00cca7a 100644
--- a/Blog/Blog.hs
+++ b/Blog/Blog.hs
@@ -95,6 +95,7 @@ editpost conf sid = Just $
                               pbody  = post -:> "body"
                           in do queryListSQL conf (updateM postModel ("id":==:sid)) [ptitle, pbody]
                                 commit conf
+                                invalidatePostsCache conf
                                 return $ redirectG "/blog/" ["code" =: "3"]
             Left e -> do cont <- returnInvalidForm conf postForm "1" e
                          return cont
diff --git a/Blog/static/index.html b/Blog/static/index.html
new file mode 100644
index 0000000..a3a798e
--- /dev/null
+++ b/Blog/static/index.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="ru">
+  <head>
+    <title>A test</title>
+    <meta name='author' content='Portnov'>
+  </head>
+
+  <body>
+  <h1>Hello world!</h1>
+  <p>Just a test.</p>
+  </body>
+</html>
diff --git a/Framework/Cache.hs b/Framework/Cache.hs
index 0aa2b08..437e0d8 100644
--- a/Framework/Cache.hs
+++ b/Framework/Cache.hs
@@ -48,7 +48,7 @@ instance CacheBackend FilesystemBackend where
     cget (FB path) name = do
         b <- doesFileExist file
         if b
-          then do s <- readFile file
+          then do s <- readFile' file
                   return $ fromString s
           else return Nothing
       where file = path </> name
ViewGit