S3存储+ knp_gaufrette + liip_imagine,未存储缓存指针

时间:2018-07-05 07:55:37

标签: amazon-s3 symfony4 liipimaginebundle gaufrette

我设置了S3存储+ knp_gaufrette + liip_imagine,缓存了大拇指

一切都想着(上传,创建大拇指) 但是总是根据每个请求创建大拇指

我得到了拇指网址- http://127.0.0.1:8002/media/cache/resolve/my_big_thumb/th5b3cc707e47253.87841978.jpg 我检查-th5b3cc707e47253.87841978.jpg存在于云中, 我错过了什么?我认为我需要创建有关拇指的缓存信息。

服务

 app_files_s3_wasabi:
        class: Aws\S3\S3Client
        factory: [Aws\S3\S3Client, 'factory']
        arguments:
          -
            endpoint: 'https://s3.wasabisys.com'
#            version: latest
            version: '2006-03-01'
#            region: "eu-central-1"
            region: "us-east-1"
            credentials:
                key: '%env(wasabi_access_key)%'
                secret: '%env(wasabi_secret_key)%'

imagine.yaml

liip_imagine:
    data_loader: loader_aws_s3_images
    loaders:
        loader_aws_s3_images:
            stream:
                # This refers to knp_gaufrette filesystems configuration
                wrapper: gaufrette://product_wasabi_thumbs_fs/
    resolvers:
#      default:
#          web_path: ~
#      cache_resolver_aws_s3:
      default:
          aws_s3:
              bucket: 'vp-network'
              client_config:
                  credentials:
                      key:   '%env(wasabi_access_key)%'
                      secret: '%env(wasabi_secret_key)%'
                  region: 'us-east-1'
                  endpoint: 'https://s3.wasabisys.com'
                  version: '2006-03-01'
#                  options:
#                      directory: 'thumbs'
#                      create: true
              get_options:
                  Scheme: 'https'
              put_options:
                  CacheControl: 'max-age=86400'
    filter_sets:
        cache: ~
        my_thumb:
            quality: 75
            filters:
                thumbnail: { size: [120, 90], mode: outbound }
        my_full_thumb:
                    quality: 75
                    filters:
                        thumbnail: { size: [1920, 1080], mode: inset }
        my_big_thumb:
            quality: 75
            filters:
                thumbnail: { size: [600, 400], mode: inset }

knp_gaufrette.yml

knp_gaufrette:
    stream_wrapper: ~
    filesystems:
        product_local_fs:
            adapter: product_local
        product_wasabi_fs:
            adapter: product_wasabi
        product_wasabi_thumbs_fs:
            adapter: product_wasabi_thumbs
        product_uploads_fs:
            adapter: product_uploads
    adapters:
        product_local:
            local:
                directory: '%kernel.project_dir%/public/products'
        product_wasabi:
            aws_s3:
                service_id: 'app_files_s3_wasabi'
                bucket_name: 'vp-network'
                options:
                    directory: 'files'
                    create: true
        product_wasabi_thumbs:
            aws_s3:
                service_id: 'app_files_s3_wasabi'
                bucket_name: 'vp-network'
                options:
                    directory: 'thumbs'
                    create: true
        product_uploads:
            aws_s3:
                service_id: 'app_files_s3_wasabi'
                bucket_name: 'vp-uploads'

vich_uploader.yaml

vich_uploader:
    db_driver: orm
    storage: gaufrette
    mappings:
        products:
            uri_prefix: https://vp-network.s3.wasabisys.com
            upload_destination: product_wasabi_fs
            namer: vich_uploader.namer_uniqid
            delete_on_remove: true
            delete_on_update: true
        products_uploads:
            uri_prefix: https://vp-uploads.s3.wasabisys.com
            upload_destination: product_uploads_fs
            delete_on_remove: true
            delete_on_update: true
        products_thumbs:
            uri_prefix: /
            namer: vich_uploader.namer_uniqid
            upload_destination: product_local_fs
            delete_on_remove: true
            delete_on_update: true

0 个答案:

没有答案