Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Transform (resize) images OnDemand #51

Open
ceefour opened this issue May 16, 2013 · 2 comments
Open

Transform (resize) images OnDemand #51

ceefour opened this issue May 16, 2013 · 2 comments
Assignees
Labels

Comments

@ceefour
Copy link
Member

ceefour commented May 16, 2013

There should be 3 modes :

  1. PREPROCESS. This is what we're doing right now.
  2. BACKGROUND. After an add, image transformation jobs are run in the background. Also during image repository initialization, untransformed images are transformed in background.
  3. ON_DEMAND. After an add, no image transformation is run. During fetch, if no transformed image is found, a transformation job is run. If the transformation takes less than threshold (say 500 ms), then the image is returned. If the transformation takes more than threshold, then a null or not found image is returned. However when the transformation eventually completes, it should be good for next request. Threshold is not accumulated, i.e. it is per method call or image, not per "web request".
@ghost ghost assigned ceefour May 16, 2013
@ceefour
Copy link
Member Author

ceefour commented Jun 26, 2015

It needs at least 8 URI generators, but not all of them used, and you must use URI templates (configured per tenant) instead of putting entire URIs in each image metadata.

8 URI templates are:

  1. Ondemand appserver
  2. Ondemand CDN-fronted
  3. File server/S3 origin
  4. File server/S3 CDN-fronted

Plus each of above for HTTPS.

@ceefour
Copy link
Member Author

ceefour commented Jun 26, 2015

On first request to appserver, it checks if file is generated and exists in image server. If so then do a redirect.

If not exist, it generate first, save, then redirect.

Same like foursquare and facebook does it.

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

No branches or pull requests

1 participant