使用Cache对象与让.net或IIS处理它 [英] Using the Cache object vs. letting .net or IIS handle it

查看:45
本文介绍了使用Cache对象与让.net或IIS处理它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天和朋友谈过了。


我正在开展一个项目,我有一个存储网站的XML文件

结构和一些以页面为中心的变量。我有一些控件,

将从这个XML文件读取。


我最初的反应是加载XML文件一次,然后设置它到一个

缓存对象,这样它就被缓存,只有在服务器上更新文件时才更新。


他说这是不必要的,因为IIS / .net会自动为你自动缓存经常访问的

文件。


有什么想法?


-Darrel

解决方案

首先你有正确的想法。你的朋友正在混淆缓存

缓存。 ;-)


-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发商

跟随者和贷款人都不是。


darrel <无***** @ hotmail.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

我有今天和朋友谈话。

我正在开发一个项目,我有一个XML文件存储网站结构和一些以页面为中心的变量。我有一些控件
将从这个XML文件中读取。

我最初的反应是加载XML文件一次,然后将其设置为
他说这是不必要的,就像IIS /。 net会自动为你自动缓存经常访问的文件。

有什么想法吗?

-Darrel



>你首先有正确的想法。你的朋友正在混淆

缓存

和缓存。 ; - )




嗯...; o)


那么,IIS / .net缓存究竟是什么默认情况下我应该什么?
显式缓存?

-Darrel


Aye ..你是对的..


O / S可能会cahce经常访问savel的文件

保存磁盘I / O工作......但这与我们正在讨论的

缓存的类型完全不同(I ''我不知道.Net做任何自动的

缓存顺便说一句。把它放在他的Cache对象中专门放入

asp.net worker处理内存空间...此外,O / S定义了什么'

" ;频繁"可能就像每个人的时间还要多了几美元......我们的情况可能好像几次......有什么好处

当你有新闻组的朋友??


Karl


-

我的ASP.Net教程
http://www.openmymind.net/ - 新增和改进(是的,弹出窗口很烦人)
http://www.openmymind.net/faq.aspx - 非官方新闻组常见问题解答(更多内容

来了!)

" Kevin Spencer" <柯*** @ DIESPAMMERSDIEtakempis.com>在消息中写道

新闻:uY ************* @ TK2MSFTNGP15.phx.gbl ...

你有正确的想法第一名。你的朋友正在通过缓存混合
缓存。 ;-)

-
HTH,

Kevin Spencer
微软MVP
.Net开发人员
也不是追随者也不是贷款人是。

darrel <无***** @ hotmail.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

我和一个人谈了一个今天的朋友。

我正在开发一个项目,我有一个XML文件存储网站结构和一些以页面为中心的变量。我有一些控件
将从这个XML文件中读取。

我最初的反应是加载XML文件一次,然后将其设置为时才更新。

他说这是不必要的,因为IIS /。 net会自动为你自动缓存经常访问的文件。

有什么想法吗?

-Darrel




I had a conversation with a friend today.

I''m working on a project where I have an XML file that stores the site
structure and some page-centric variables. I have a handful of controls that
will be reading from this XML file.

My initial reaction was to load the XML file once, and then set it to a
cache object, so that it''s cached and only updated if the file is updated on
the server.

He said that was unecessary, as IIS/.net will cache frequently accessed
files automatically for you.

Any thoughts on that?

-Darrel

解决方案

You had the right idea in the first place. Your friend is mixing up caching
with caching. ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

I had a conversation with a friend today.

I''m working on a project where I have an XML file that stores the site
structure and some page-centric variables. I have a handful of controls
that
will be reading from this XML file.

My initial reaction was to load the XML file once, and then set it to a
cache object, so that it''s cached and only updated if the file is updated
on
the server.

He said that was unecessary, as IIS/.net will cache frequently accessed
files automatically for you.

Any thoughts on that?

-Darrel



> You had the right idea in the first place. Your friend is mixing up
caching

with caching. ;-)



Hmm...;o)

So, what, exactly, does IIS/.net cache by default vs. what should I
explicitly cache?

-Darrel


Aye...you are right..

The O/S will likely "cahce" files that are being frequently access to savel
save the disk I/O work...but this is really different than the type of
caching we are talking about (I''m not aware of .Net doing any automatic
caching btw). putting it int he Cache object specifically puts in in the
asp.net worker processes memory space...Besides, the O/S definion of what''s
"frequent" could be like hundres of times per
second....where as ours could be like a couple times....what good are
friends for when you got newsgroups??

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uY*************@TK2MSFTNGP15.phx.gbl...

You had the right idea in the first place. Your friend is mixing up caching with caching. ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"darrel" <no*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

I had a conversation with a friend today.

I''m working on a project where I have an XML file that stores the site
structure and some page-centric variables. I have a handful of controls
that
will be reading from this XML file.

My initial reaction was to load the XML file once, and then set it to a
cache object, so that it''s cached and only updated if the file is updated on
the server.

He said that was unecessary, as IIS/.net will cache frequently accessed
files automatically for you.

Any thoughts on that?

-Darrel




这篇关于使用Cache对象与让.net或IIS处理它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆