diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,6 +1,11 @@
 # Revision history for Selda
 
 
+## 0.1.11.1 -- 2017-10-10
+
+* Fix rare infinite loop bug in in-process cache.
+
+
 ## 0.1.11.0 -- 2017-09-08
 
 * Fix name generation in the presence of isIn over queries.
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -723,7 +723,7 @@
 
 Features that would be nice to have but are not yet implemented.
 
-* If/else.
+* Monadic if/else.
 * Streaming
 * Type-safe migrations
 * `SELECT INTO`.
diff --git a/selda.cabal b/selda.cabal
--- a/selda.cabal
+++ b/selda.cabal
@@ -1,5 +1,5 @@
 name:                selda
-version:             0.1.11.0
+version:             0.1.11.1
 synopsis:            Type-safe, high-level EDSL for interacting with relational databases.
 description:         This package provides an EDSL for writing portable, type-safe, high-level
                      database code. Its feature set includes querying and modifying databases,
diff --git a/src/Database/Selda/Caching.hs b/src/Database/Selda/Caching.hs
--- a/src/Database/Selda/Caching.hs
+++ b/src/Database/Selda/Caching.hs
@@ -22,6 +22,10 @@
 
 type CacheKey = (Text, Text, [Param])
 
+-- | Reduce all parts of a cache key to HNF.
+seqCK :: CacheKey -> a -> a
+seqCK (db, q, ps) x = db `seq` q `seq` ps `seq` x
+
 #ifdef NO_LOCALCACHE
 
 cache :: Typeable a => [TableName] -> CacheKey -> a -> IO ()
@@ -81,7 +85,7 @@
 
 -- | Cache the given value, with the given table dependencies.
 cache :: Typeable a => [TableName] -> CacheKey -> a -> IO ()
-cache tns k v = atomicModifyIORef' theCache $ \c -> (cache' tns k v c, ())
+cache tns k v = k `seqCK` atomicModifyIORef' theCache (\c -> (cache' tns k v c, ()))
 
 cache' :: Typeable a => [TableName] -> CacheKey -> a -> ResultCache -> ResultCache
 cache' tns k v rc
@@ -105,7 +109,7 @@
 
 -- | Get the cached value for the given key, if it exists.
 cached :: forall a. Typeable a => CacheKey -> IO (Maybe a)
-cached k = atomicModifyIORef' theCache $ cached' k
+cached k = k `seqCK` atomicModifyIORef' theCache (cached' k)
 
 cached' :: forall a. Typeable a => CacheKey -> ResultCache -> (ResultCache, Maybe a)
 cached' k rc = do
