简体   繁体   中英

dynamic image / captcha image over load-balanced servers

i have two servers which are load balanced in such aa way that each page request will be served from any one of the servers.

And in the project i am creating captcha images which will be created on any of the server which serves the page, and while loading it in browser ( img src) the call goes to other server because of the load balance implementation.

is there any workaround for this issue.

I am not sure whether this is the best solution.

i fixed the issue by reading up the captcha image as BLOB using file_get_contents function soon after the creating the image, and printed the image as BLOB image over HTML img src tag. so that no http request for image is send to the server.

The problem got solved for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM