I am working on a Laravel platform and currently i am in a doubt whether to use Base64 to save the user profile images or store them as a url to the file. I am new with Base64 and still don't know its pros and cons. Can someone help me explain when it is good to use the Base64 and when not to?
Thanks
Base64 images can be statically used in limited purpose by converting image to Base64. The generated code of Base64 is large.
Base64 encoding increases the storage requirement by 33% over a raw binary format. It also increases the amount of data that must be read from persistent storage, which is still generally the largest bottleneck in computing. It's generally faster to read less bytes and encode them on the fly. However, if your system is CPU bound instead of IO bound, then consider storing in base64. Also, inline images are a bottleneck themselves--you're sending 33% more data over the wire, and doing it serially. Whatever you do, make sure you don't store base64 encoded data as UTF8