Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Enable webp will prevent image cached in result_storage #54

Closed
augustine-tran opened this issue Nov 22, 2016 · 6 comments
Closed

Enable webp will prevent image cached in result_storage #54

augustine-tran opened this issue Nov 22, 2016 · 6 comments

Comments

@augustine-tran
Copy link

I noticed that after enable AUTO_WEBP=True then image don't auto save to result_storage folder. Here is my docker-compose.yml config

thumbor:
    image: apsl/thumbor
    volumes:
      - ./stack/thumbor/.data:/data
    environment:
      - ALLOW_UNSAFE_URL=True
      - SECURITY_KEY=Cyberdyne2017
      - RESULT_STORAGE_STORES_UNSAFE=True
      - AUTO_WEBP=True
  nginx:
    image: apsl/thumbor-nginx:latest
    links:
      - thumbor:thumbor
    volumes:
      - ./stack/thumbor/.data:/data
    ports:
      - 12003:80

Not sure if its related to this issue Webp from result_storage is not setting Vary header #731
.

@eduherraiz
Copy link
Member

Thanks for report the issue @rualatngua .
I found the webp images are stored in a different way, using a subfolder called "webp" inside the result_storage. Because of that, the nginx can't found them.
Let me think a while how to deal with this.

@eduherraiz
Copy link
Member

We will have to implement a webp use case in nginx:
https://github.com/uhop/grunt-tight-sprite/wiki/Recipe:-serve-WebP-with-nginx-conditionally

@eduherraiz
Copy link
Member

eduherraiz commented Nov 24, 2016

Implemented a way to do the webp cache in nginx in the branch 6.2.0b.
https://github.com/APSL/docker-thumbor/compare/6.2.0b

Now, thumbor-nginx is smart enough to know if the browser allows webp, and use the correct directory cache (webp or not) or do the failover to thumbor.

@rualatngua You can found the tag 6.2.0b in the docker hub to test it!
I will test it a few days before release to master/latest.

You need to include the AUTO_WEBP=True envvar to thumbor-nginx too!

@eduherraiz
Copy link
Member

👏 👏 👏
A public applause to @paurullan that helps to debug a very tricky nginx config problem: https://trac.nginx.org/nginx/ticket/1142#ticket

@augustine-tran
Copy link
Author

Thank @eduherraiz. Let me try 6.2.2b in a few days and back to you soon.

@eduherraiz
Copy link
Member

Available in 6.2.0b version

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants