Skip to content

Commit e0bd7fc

Browse files
committed
Merge pull request #448 from edsko/pr/enable-range-requests-for-tgz
Enable range reuqests for the 01-index.tar.gz
2 parents 067506e + 9112b19 commit e0bd7fc

File tree

1 file changed

+2
-1
lines changed
  • Distribution/Server/Features

1 file changed

+2
-1
lines changed

Distribution/Server/Features/Core.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,13 +608,15 @@ coreFeature ServerEnv{serverBlobStore = store} UserFeature{..}
608608
tarball <- indexTarballLegacyGz <$> readAsyncCache cacheIndexTarball
609609
let tarballmd5 = show $ tarGzHashMD5 tarball
610610
cacheControl [Public, NoTransform, maxAgeMinutes 5] (ETag tarballmd5)
611+
enableRange
611612
return $ toResponse tarball
612613

613614
serveIncremPackagesIndexTarGz :: DynamicPath -> ServerPartE Response
614615
serveIncremPackagesIndexTarGz _ = do
615616
tarball <- indexTarballIncremGz <$> readAsyncCache cacheIndexTarball
616617
let tarballmd5 = show $ tarGzHashMD5 tarball
617618
cacheControl [Public, NoTransform, maxAgeMinutes 5] (ETag tarballmd5)
619+
enableRange
618620
return $ toResponse tarball
619621

620622
serveIncremPackagesIndexTar :: DynamicPath -> ServerPartE Response
@@ -623,7 +625,6 @@ coreFeature ServerEnv{serverBlobStore = store} UserFeature{..}
623625
let tarballmd5 = show $ tarHashMD5 tarball
624626
cacheControl [Public, NoTransform, maxAgeMinutes 5] (ETag tarballmd5)
625627
enableRange
626-
enableGZip' 3 -- Low compression level to save server CPU
627628
return $ toResponse tarball
628629

629630
-- TODO: should we include more information here? description and

0 commit comments

Comments
 (0)