关于php验证码字体的问题
我正在研究我的验证码图像脚本,我知道我使用的字体存储在服务器端,但我想知道对于高流量网站,字体大小(如 kb 和 mb 而不是尺寸)是否会对服务器? 我弄乱的一些字体大约是 4-5mb,有些则低于 1mb,是使用最小的字体更好还是没有区别?
I am working on my captcha image script, I know the fonts I use are stored on the server end but I am wondering for a high traffic site, does the font size (like kb and mb not dimensions) does it make a difference on the server? Some font's I was messing with are like 4-5mb and then some are under 1mb, is it better to use the smallest fonts or does it not make a difference?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这些字体用于生成验证码图像,则不会将其发送给您网站的访问者。 在这种情况下,它们仅由图像生成库在内部读取,在这种情况下,您唯一需要担心的是磁盘/内存访问时间。
我不认为读取字体文件会给您带来任何性能问题。 图像生成可能会更加耗时,如果需要的话,这将是一个更好的优化位置。 但是,除非您遇到问题,否则过早的优化通常不会很好地利用您的时间。
The fonts are not being sent to the visitors of your site if they are being used to generate a captcha image. In this case, they are only being read internally by your image generation libraries, in which case the only thing you have to worry about is disk/memory access time.
I don't think reading the font files is going to give you any performance problems. The image generation is likely a lot more time-consuming, and would be a better place to optimize if you needed to. However, unless you're having problems with it, premature optimization is generally not a good use of your time.