mirror of
https://github.com/distribution/distribution.git
synced 2025-09-02 15:36:10 +00:00
Integrate layer info cache with registry and storage
This changeset integrates the layer info cache with the registry webapp and storage backend. The main benefit is to cache immutable layer meta data, reducing backend roundtrips. The cache can be configured to use either redis or an inmemory cache. This provides massive performance benefits for HEAD http checks on layer blobs and manifest verification. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/docker/distribution/registry/auth"
|
||||
_ "github.com/docker/distribution/registry/auth/silly"
|
||||
"github.com/docker/distribution/registry/storage"
|
||||
"github.com/docker/distribution/registry/storage/cache"
|
||||
"github.com/docker/distribution/registry/storage/driver/inmemory"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
@@ -28,7 +29,7 @@ func TestAppDispatcher(t *testing.T) {
|
||||
Context: context.Background(),
|
||||
router: v2.Router(),
|
||||
driver: driver,
|
||||
registry: storage.NewRegistryWithDriver(driver),
|
||||
registry: storage.NewRegistryWithDriver(driver, cache.NewInMemoryLayerInfoCache()),
|
||||
}
|
||||
server := httptest.NewServer(app)
|
||||
router := v2.Router()
|
||||
|
Reference in New Issue
Block a user