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:
Konstantin Zudov 2015-11-16 13:34:59 +02:00
parent 0233d07f4c
commit ad053dc101

View file

@ -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)