What are all the disdvantages of using Cache in aspnet?
As I said above, I want to know what are all the disadvantage of using cache? Is that good to use cache in a w开发者_运维技巧ebsite?
I don't see any disadvantages to using the cache.
The only disadvantages if you can call them that is incorrect usage.
There are several potential problems when using the cache though:
- You will experience increased memory usage if you store objects in memory instead of a database
- You may end up storing objects in cache that you don't want there (old objects or dynamic data for instance)
- You may cache too much - causing you applications performance to degrade since your cache eats all the servers resources
- You may cache too little ending up with a system with increased complexity and no performance gain
- You may cache wrong data
And so on. Caching is hard, but used correctly it is a Good Thing.
Cache is a good thing. It will help your site run faster and avoid downloading the same content over and over again. Of course you should avoid caching for dynamically generated pages.
Another problem is with the caching of images or similar resources. If you do use caching for them, it will be tricky to update them when the need arises. You should always choose the caching times properly, making a compromise between faster loading and update efficiency.
精彩评论