开发者

Better approach to saving Webpage content to database for caching

i want to know which approach is better to saving Webpage content to database for caching?

  1. Using ntext data-type and save content as flat string
  2. Using ntext, but compress content and then save
  3. Using varbinary(MAX) to save content (how i can convert flat string to binary? ;-))
  4. An other approach which you are suggest to me

UPDATE

in more depth i have many table (URLs, Caches, ParsedContents, Words, Hits and etc) which for each url in URLs table i'm sending request and save response into caches table. this is Downloader (URLResolver of Google) section of my engine. then indexer section act was to perform parsing and etc tasks which associated with this. and Compress/Decompress performs only when开发者_StackOverflow中文版 new content goes to be caching or parsing


The better approach would be to use the built-in caching features in ASP.NET. Searching StackOverflow for [asp.net] [caching] is a good start, and after (or before) that, similar searches on both www.asp.net and Google will get you quite far.


In response to your comment, I would probably save the data as a flat string. It might not be the best option performance-wise when it comes to storage, but if you're going to perform searches on the text content, you don't want to have to compress/decompress or convert to/from binary every time, since there is probably no (easy) way to do this inside SQL Server. Just make sure you have all intexes and full-text features you need set up correctly.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜