mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 12:18:29 +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 pname branch = do
|
||||
cacheSeconds (3 * 60 * 60)
|
||||
snapName <- maybe notFound pure =<< newestSnapshot branch
|
||||
Entity sid _ <- maybe notFound pure =<< lookupSnapshot snapName
|
||||
mVersion <- do mSnapPackage <- lookupSnapshotPackage sid (unPackageName pname)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user