473,396 Members | 2,121 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,396 software developers and data experts.

Problem with output caching

Is anyone able to get output caching to work on web services?

I have followed KB 318299 which involves adding a method like the one below and calling twice within a short period of time. The second execution should use the result from the cache of first execution, but does not and executes the method a second time.

[WebMethod( CacheDuration=600 )]
public string CacheTest()
{
StringBuilder sb = new StringBuilder( "Method executed at " );
sb.Append(System.DateTime.Now.ToString());
return( sb.ToString() );
}

Result 1.....

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Method executed at 29/07/2004 23:16:05</string>

Result 2 ... just 2 seconds later

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Method executed at 29/07/2004 23:16:07</string>

Nov 21 '05 #1
3 1921
My understanding was that output caching only works in Web services if the
Web service is compiled stand-alone, rather than together with a client.
Make sure that they are compiled separately and then test your scenario
again.

Jeffrey Hasan, MCSD
President, Bluestone Partners, Inc.
-----------------------------------------------
Author of: Expert SOA in C# Using WSE 2.0 (APress, 2004)
http://www.bluestonepartners.com/soa.aspx

"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
Is anyone able to get output caching to work on web services?

I have followed KB 318299 which involves adding a method like the one below and calling twice within a short period of time. The second execution
should use the result from the cache of first execution, but does not and
executes the method a second time.
[WebMethod( CacheDuration=600 )]
public string CacheTest()
{
StringBuilder sb = new StringBuilder( "Method executed at " );
sb.Append(System.DateTime.Now.ToString());
return( sb.ToString() );
}

Result 1.....

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Method executed at 29/07/2004 23:16:05</string>
Result 2 ... just 2 seconds later

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Method executed at 29/07/2004 23:16:07</string>

Nov 21 '05 #2
OK, it does work with a seperate client...
The MS KB article http://support.microsoft.com/default...b;en-us;318299 describes testing the caching from the test page that is generated by the web service and this does not work. I would like MSoft to correct the article.

Thanks for your help...

"Jeffrey Hasan" wrote:
My understanding was that output caching only works in Web services if the
Web service is compiled stand-alone, rather than together with a client.
Make sure that they are compiled separately and then test your scenario
again.

Jeffrey Hasan, MCSD
President, Bluestone Partners, Inc.
-----------------------------------------------
Author of: Expert SOA in C# Using WSE 2.0 (APress, 2004)
http://www.bluestonepartners.com/soa.aspx

"Jack" <Ja**@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
Is anyone able to get output caching to work on web services?

I have followed KB 318299 which involves adding a method like the one

below and calling twice within a short period of time. The second execution
should use the result from the cache of first execution, but does not and
executes the method a second time.

[WebMethod( CacheDuration=600 )]
public string CacheTest()
{
StringBuilder sb = new StringBuilder( "Method executed at " );
sb.Append(System.DateTime.Now.ToString());
return( sb.ToString() );
}

Result 1.....

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Method executed at 29/07/2004

23:16:05</string>

Result 2 ... just 2 seconds later

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Method executed at 29/07/2004

23:16:07</string>


Nov 21 '05 #3
Thanks for your response but I need some help here.
Do I need to move the webservice to another project or another virtual
directory to have it compile separetly? Where are the project dlls stored in
v2?
Glenn Michael

Nov 27 '06 #4

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

Similar topics

2
by: Mike Sobeiski | last post by:
Hi There! I'm developing a web project that requires to produce charts off the database and output it as image and presented to the user in a HTML document. (NOTE: Image is not directly...
2
by: Tim Mavers | last post by:
Is there a setting in the web.config that will enable page-output caching for an entire site? All the documentation I find on output caching deals at the page or sub-page level. I saw a couple...
2
by: R-D-C | last post by:
Can these two functions coexist? We have a web site where the querystrings are removed using URL Rewriting. Instead the page appears to be a html page with a long name (containing what would be...
1
by: Ben Fidge | last post by:
What are best practices for page output caching on pages that are dynamically generated from database tables. Our site has left-hand navigation that is comprised of dynamically generated menus...
102
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem...
0
by: jason | last post by:
hi experts, support.microsoft.com/kb/917072 and http://msdn.microsoft.com/msdnmag/issues/06/07/WebAppFollies/ As pointed out in these articles, users might get session variables belong to...
0
by: archana | last post by:
Hi all, Can someone tell me how the caching is implemented. Means how data is stored in output caching and data caching. If i am using output caching will that cache maintain on client side?...
2
by: Cramer | last post by:
I'm creating a custom handler that does not extend Page (only implements IHttpHandler) - and I would like for its output to be cached to improve runtime performance. I would like to leverage...
2
by: Ken Fine | last post by:
I have a question about ASP.NET output caching. I want to use screen scraping as a temporary hack to pull in some complex Classic ASP-rendered content into some ASP.NET pages: protected String...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.