diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
 # Changelog
 
+## [0.2.0.2] - 2026-05-05
+
+### Changed
+
+* The first metrics sample is now collected lazily on the first request rather
+  than eagerly at startup when caching is enabled.
+
 ## [0.2.0.1] - 2025-12-18
 
 ### Changed
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/prometheus-wai.cabal b/prometheus-wai.cabal
--- a/prometheus-wai.cabal
+++ b/prometheus-wai.cabal
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.36.1.
+-- This file has been generated from package.yaml by hpack version 0.38.3.
 --
 -- see: https://github.com/sol/hpack
 
 name:           prometheus-wai
-version:        0.2.0.1
+version:        0.2.0.2
 description:    Prometheus metrics for WAI applications
 homepage:       https://github.com/NorfairKing/prometheus-wai#readme
 bug-reports:    https://github.com/NorfairKing/prometheus-wai/issues
diff --git a/src/System/Metrics/Prometheus/Wai/Middleware.hs b/src/System/Metrics/Prometheus/Wai/Middleware.hs
--- a/src/System/Metrics/Prometheus/Wai/Middleware.hs
+++ b/src/System/Metrics/Prometheus/Wai/Middleware.hs
@@ -6,6 +6,7 @@
   ( registerWaiMetrics,
     WaiMetrics (..),
     instrumentWaiMiddleware,
+    instrumentWaiMiddlewareWith,
     combineRegistrySample,
     MetricsEndpoint (..),
     defaultMetricsEndpoint,
@@ -81,7 +82,13 @@
 
 -- | Record the given Wai metrics in a middleware.
 instrumentWaiMiddleware :: WaiMetrics -> Wai.Middleware
-instrumentWaiMiddleware WaiMetrics {..} application request sendResponse =
+instrumentWaiMiddleware = instrumentWaiMiddlewareWith (const True)
+
+-- | Like 'instrumentWaiMiddleware' but only instruments requests for which the
+-- predicate returns 'True'. Requests that return 'False' are passed through
+-- without recording any metrics.
+instrumentWaiMiddlewareWith :: (Wai.Request -> Bool) -> WaiMetrics -> Wai.Middleware
+instrumentWaiMiddlewareWith shouldRecord WaiMetrics {..} application request sendResponse =
   let isWebSocketsReq =
         lookup "upgrade" (Wai.requestHeaders request) == Just "websocket"
       shouldInstrument =
@@ -91,6 +98,7 @@
         -- Moreover, the 'latency' will be 'how long the connection was open'
         -- which is also useless.
         not isWebSocketsReq
+          && shouldRecord request
    in if shouldInstrument
         then do
           begin <- getMonotonicTimeNSec
@@ -158,9 +166,9 @@
   -- might as well lift already.
   liftIO $ do
     mCache <- forM metricsEndpointCacheDurationNanos $ \cacheDurationNanos -> do
-      begin <- getMonotonicTimeNSec
-      firstSample <- metricsEndpointSample
-      var <- newMVar (begin, firstSample)
+      -- Use timestamp 0 so the cache is expired on first use, collecting the
+      -- first sample lazily on the first request rather than at startup.
+      var <- newMVar (0, Prometheus.RegistrySample M.empty)
       pure (cacheDurationNanos, var)
 
     let sampleWithCache :: IO Prometheus.RegistrySample
