473,388 Members | 1,277 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

cache

All,

Can we enable/disable the cache for each control separately or it's a global
feature for the whole page? I'm aware of many settings and some bugs
regarding cache but I've never seen anything on a control based level. I
know that if we place these 3 strings in aspx header then we can kill the
most of the caches beginning from the server and down to the client machine.

<META http-equiv="Pragma" content="NO-CACHE">
<META http-equiv="Expires" content="-1">
<META http-equiv="CACHE-CONTROL" content="NO-CACHE">

We also can use that in C# file on Page_Load()

Response.Cache.SetCacheability(HttpCacheability.No Cache);

for the same purpose and it really works great.

But I still want to enable caching for some of the controls, JS, Images,
etc. to reload only the dynamic content of the page. I know that if the JS
are placed into the separate files then they will be cached on the client
side, but maybe I'm wrong with that.

The only real reason why I started this war with caches is a lot of bugs and
problems in all layers beginning from the browsers. If the user clicks the
button then the datagrid for example should refresh of something and then
the page should show the updated content of the datagrid. It's just one of
many example. In real life everytihg's fine, I see in the debugger that it
works, but the client machine decides for some reason that the page content
wasn't updated, it has its own opinion about that, and shows the previous
page from its buffer. Crap! When I disabled all possible and impossible
caches it started working great but the delay before click-see became longer
and in some places significantly longer. That's why I wanted to cache some
heavy elements and disable the cache for the dynamic ones only.

One additional info - the released app works under SSL HTTPS, so the
encrypted pages should not be saved on the client machine by default...
theretically.

PLease help who knows about these bugs and features more.

Thanks,
Just D.
Mar 1 '06 #1
2 1717
One option is to add a control to a user control. That way you can handle
caching with @outputcache directives.

http://msdn.microsoft.com/library/de...utputcache.asp

"Setting values for the page output cache is the same as manipulating the
HttpCachePolicy.SetExpires and HttpCachePolicy.SetCacheability methods
through the HttpResponse.Cache property."
"Just D." <no@spam.please> wrote in message
news:MTpNf.251$y24.213@fed1read10...
All,

Can we enable/disable the cache for each control separately or it's a
global feature for the whole page? I'm aware of many settings and some
bugs regarding cache but I've never seen anything on a control based
level. I know that if we place these 3 strings in aspx header then we can
kill the most of the caches beginning from the server and down to the
client machine.

<META http-equiv="Pragma" content="NO-CACHE">
<META http-equiv="Expires" content="-1">
<META http-equiv="CACHE-CONTROL" content="NO-CACHE">

We also can use that in C# file on Page_Load()

Response.Cache.SetCacheability(HttpCacheability.No Cache);

for the same purpose and it really works great.

But I still want to enable caching for some of the controls, JS, Images,
etc. to reload only the dynamic content of the page. I know that if the JS
are placed into the separate files then they will be cached on the client
side, but maybe I'm wrong with that.

The only real reason why I started this war with caches is a lot of bugs
and problems in all layers beginning from the browsers. If the user clicks
the button then the datagrid for example should refresh of something and
then the page should show the updated content of the datagrid. It's just
one of many example. In real life everytihg's fine, I see in the debugger
that it works, but the client machine decides for some reason that the
page content wasn't updated, it has its own opinion about that, and shows
the previous page from its buffer. Crap! When I disabled all possible and
impossible caches it started working great but the delay before click-see
became longer and in some places significantly longer. That's why I wanted
to cache some heavy elements and disable the cache for the dynamic ones
only.

One additional info - the released app works under SSL HTTPS, so the
encrypted pages should not be saved on the client machine by default...
theretically.

PLease help who knows about these bugs and features more.

Thanks,
Just D.

Mar 2 '06 #2
Thanks, Ken!

That's interesting, I'm just wondering if I can enable caching for a list of
controls, but this is a good start to read about this stuff.

Just D.
"Ken Cox - Microsoft MVP" <BA**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
One option is to add a control to a user control. That way you can handle
caching with @outputcache directives.

http://msdn.microsoft.com/library/de...utputcache.asp

"Setting values for the page output cache is the same as manipulating the
HttpCachePolicy.SetExpires and HttpCachePolicy.SetCacheability methods
through the HttpResponse.Cache property."
"Just D." <no@spam.please> wrote in message
news:MTpNf.251$y24.213@fed1read10...
All,

Can we enable/disable the cache for each control separately or it's a
global feature for the whole page? I'm aware of many settings and some
bugs regarding cache but I've never seen anything on a control based
level. I know that if we place these 3 strings in aspx header then we can
kill the most of the caches beginning from the server and down to the
client machine.

<META http-equiv="Pragma" content="NO-CACHE">
<META http-equiv="Expires" content="-1">
<META http-equiv="CACHE-CONTROL" content="NO-CACHE">

We also can use that in C# file on Page_Load()

Response.Cache.SetCacheability(HttpCacheability.No Cache);

for the same purpose and it really works great.

But I still want to enable caching for some of the controls, JS, Images,
etc. to reload only the dynamic content of the page. I know that if the
JS are placed into the separate files then they will be cached on the
client side, but maybe I'm wrong with that.

The only real reason why I started this war with caches is a lot of bugs
and problems in all layers beginning from the browsers. If the user
clicks the button then the datagrid for example should refresh of
something and then the page should show the updated content of the
datagrid. It's just one of many example. In real life everytihg's fine, I
see in the debugger that it works, but the client machine decides for
some reason that the page content wasn't updated, it has its own opinion
about that, and shows the previous page from its buffer. Crap! When I
disabled all possible and impossible caches it started working great but
the delay before click-see became longer and in some places significantly
longer. That's why I wanted to cache some heavy elements and disable the
cache for the dynamic ones only.

One additional info - the released app works under SSL HTTPS, so the
encrypted pages should not be saved on the client machine by default...
theretically.

PLease help who knows about these bugs and features more.

Thanks,
Just D.


Mar 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
5
by: Darrel | last post by:
I thought this warranted a new thread. Yesterday I asked about access relatively static content...is it better to read from the DB, or just grab a text file. It was suggested that I use the DB...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
1
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). ...
13
by: Andrew Morton | last post by:
I am caching some data in VB.NET using System.Web.Caching, is it possible to lock the cache so that other sessions attempting to access the same cache wait when it is being updated? I have the...
26
by: Ed L. | last post by:
Here's some of my current notions on pgsql performance tuning strictly as it relates to pgsql tuning parameters in the context of a dedicated linux or hpux server. I'm particularly focusing on...
18
by: siddharthkhare | last post by:
Hi All, what is the diference between these two cache control header. no-cache and no-store. I have read the w3.org explanation. So lets say I am using only no-cache ....my understanding is...
0
by: mateipuiu | last post by:
When a try to run a client build on 2005, which uses the Microsoft.ApplicationBlocks.Cache.dll reference, when using a Microsoft.ApplicationBlocks.Cache.dll created on Debug mode, the client works...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
0
by: =?Utf-8?B?YmlqYXk=?= | last post by:
The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.