Partial-page cache getting repeatedly invalidated

Y

yashgt

Hi,

We have a control Logo.ascx, which queries the DB to obtain the logo
image from a blob in the DB and renders it on the page.
The logo does not change frequently and hence we have tried to create
a cache for it:
<%@ OutputCache Duration="600" VaryByParam="None"
SqlDependency="EMAMDB:EMAM_Clients" %>
The cache will thus be invalidated every 10 min and also depending on
the changes to the EMAM_Clients table which has only one entry.

The dependency is set as follows:
<caching>
<sqlCacheDependency enabled="true" pollTime="1000">
<databases>
<add name="EMAMDB" connectionStringName="EMAMConnectionString"/>
</databases>
</sqlCacheDependency>
</caching>
The polling thus happens every second.

So we expect that if we refresh the page repeatedly once, the DB
stored proc that retrieves the logo should not be called each time.
However this is not the observed case. Almost every alternate refresh
causes the DB to be queried. We have also traced the code to verify
this. We have seen the
dbo.AspNet_SqlCachePollingStoredProcedure being called every second,
which means the Changes do get tracked, and we know for sure that
nobody is changing the table.

Why then is the cache invalidated every now and then?

Thanks,
Yash
 
Y

yashgt

Just realized that this problem occurs only on the in-built web server
in VS 2005. The application behaves as expected when run in IIS.

-Yash
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top