开发者

Question for web developers: using an image server for dynamic images

开发者 https://www.devze.com 2023-04-04 13:26 出处:网络
Supposing you were designing an image gallery website that uses dynamic images. By dynamic, I mean that these images can be converted to different formats, scaled, cropped and watermarked on the fly.

Supposing you were designing an image gallery website that uses dynamic images. By dynamic, I mean that these images can be converted to different formats, scaled, cropped and watermarked on the fly. The dynamic images are retrieved from an image server (running separately from the web server) that keeps only one source image and responds to HTTP POST requests (in JSON).

Would you as a web developer find it easy to de开发者_C百科velop a website using an image server like this? If so, how would you retrieve and display the images? If not, what would you change about the image server?

This is an open ended question, so I'm just wondering how suitable an image server designed in this way would be for a web developer, and for the application mentioned above.


Images are shown to endusers via <img ..../> tag, which implies GET request. For each img GET request I would need to do the following:

  • analyze GET request path and parameters
  • generate new POST request to the image server
  • retrieve image bytes from image server
  • create http response with appropriate content-type and length
  • send image bytes to enduser

No, I cant say it's an easy solution and it'd be much easier if it were not for such GET-POST-GET conversion.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号