Skip to content

Handle image cache resolve on Nginx side#7

Open
lecajer wants to merge 1 commit intoSylius:mainfrom
lecajer:patch-1
Open

Handle image cache resolve on Nginx side#7
lecajer wants to merge 1 commit intoSylius:mainfrom
lecajer:patch-1

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