Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle image cache resolve on Nginx side #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lecajer
Copy link

@lecajer lecajer commented May 26, 2024

Simplify usage for client that should not take care of image cache state. A common usecase is when a Storefront consume Sylius API

In image cache is missing, NginX will call Sylius with /resolve and then serve the image to the client.

Whitout this:

GET /media/cache/image/xx/yy.img.jpg 404

Then client has to do

GET /media/cache/image/resolve/xx/yy.img.jpg 302 (or 404)
GET /media/cache/image/xx/yy.img.jpg 200

With this change

GET /media/cache/image/xx/yy.img.jpg 200 (or 404)

NginX takes care of checking if the cache exists and generate it if not.

Simplify usage for client that should not take care of image cache state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant