开发者

What is imapact of caching images on overall sites performance ? (small 200x150 size images, total 50 such images)

开发者 https://www.devze.com 2022-12-08 04:22 出处:网络
images are stored in database. I am thinking of storing top 50 images in Asp.net Cache, What imapact does it have memory or overall sites performance.Each image is 200 x 150 in s开发者_运维问答ize. Si

images are stored in database. I am thinking of storing top 50 images in Asp.net Cache , What imapact does it have memory or overall sites performance. Each image is 200 x 150 in s开发者_运维问答ize. Site is hosted , hosting plan is not that high. 15 $ /month.


Generally, the first step to higher performance would be to move images out of the DB, and simply have urls in the DB. You can then have your site serve those images as static files, very quickly. The OS/server should automatically cache according to available memory. This also has a number of other advantages:

  • You can easily put a caching proxy server in front of the real web server, for even higher performance or load balancing.

  • You can move the static file server to an entirely different webserver (or cluster of webservers) from the actual webapp. Again, load balancing, but also tuning of servers (performance and security) for different specialised tasks.

  • You can put the files on a redundant, scaleable, high-performance NAS.

  • You can do all of the above, in any combination.

  • Since they'll be static files, not from a DB, other caching proxies (say, at a big ISP) will store them for you, reducing your bandwidth, and increasing performance for users.

p.s.: given all the advantages of this small seperation of static files and dynamic database information, you could learn a lot about orthogonal system design from this example ;)

0

精彩评论

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