mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-31 13:20:26 +01:00
Set Cache-Control header on badges
Since github caches external resource we need to indicate that this badge is supposed to be changing. https://github.com/github/markup/issues/224
This commit is contained in:
parent
0233d07f4c
commit
ad053dc101
@ -27,6 +27,7 @@ getPackageR = packagePage Nothing
|
|||||||
|
|
||||||
getPackageBadgeR :: PackageName -> SnapshotBranch -> Handler TypedContent
|
getPackageBadgeR :: PackageName -> SnapshotBranch -> Handler TypedContent
|
||||||
getPackageBadgeR pname branch = do
|
getPackageBadgeR pname branch = do
|
||||||
|
cacheSeconds (3 * 60 * 60)
|
||||||
snapName <- maybe notFound pure =<< newestSnapshot branch
|
snapName <- maybe notFound pure =<< newestSnapshot branch
|
||||||
Entity sid _ <- maybe notFound pure =<< lookupSnapshot snapName
|
Entity sid _ <- maybe notFound pure =<< lookupSnapshot snapName
|
||||||
mVersion <- do mSnapPackage <- lookupSnapshotPackage sid (unPackageName pname)
|
mVersion <- do mSnapPackage <- lookupSnapshotPackage sid (unPackageName pname)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user