Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 141839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:50:27+00:00 2026-05-11T07:50:27+00:00

How can I use web server cache in a similar way as the following

  • 0

How can I use web server cache in a similar way as the following VB code does:

   ////  FindData() returns real data    //// FindCached() returns from cache (kept 20 minute)      Protected Function RegisterCachedData(ByVal id As String) As Integer         Dim onCacheRemove As CacheItemRemovedCallback         onCacheRemove = New CacheItemRemovedCallback(AddressOf Me.CheckCallback)         Cache.Insert('AverageData', FindData(1), Nothing, DateTime.Now.AddMinutes(20), TimeSpan.Zero, 1, onCacheRemove)     End Function      Sub CheckCallback(ByVal str As String, ByVal obj As Object, ByVal reason As CacheItemRemovedReason)         RegisterCachedData(0)     End Sub     Protected Function FindCached() As Integer         If Cache.Get('AverageData') Is Nothing Then RegisterCachedData(0)         Return Cache.Get('AverageData')     End Function 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:50:28+00:00Added an answer on May 11, 2026 at 7:50 am

    The same way. This should do it:

    protected int RegisterCachedData(string id) {    CacheItemRemovedCallback onCacheRemove;    onCacheRemove = new CacheItemRemovedCallback(CheckCallback);    Cache.Insert('AverageData', FindData(1), null, DateTime.Now.AddMinutes(20), TimeSpan.Zero, 1, onCacheRemove); }  void CheckCallback(string str, object obj, CacheItemRemovedReason reason) {    RegisterCachedData('0'); }  protected int FindCached() {    if (Cache.Get('AverageData') == null) RegisterCachedData('0');    return Cache.Get('AverageData'); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a Windows Server Web Edition 2003 Web Farm. What can we use
In IIS 6, I can use the Web Service Extensions folder in Inetmgr to
We have got a setup where users can either use a web-based form or
Can anyone suggest a good reason to use web services instead of RPC (not
I have a web app that only registered users can use, therefore I should
There's a web services I want to call in my application, I can use
In Windows, in any windows form or web browser, you can use the tab
Can anyone recommend a framework or basic technology to use to host a web
I use IIS web server 7.5 on Windows 7 for hosting my project. I
I'm using mod_mem_cache in my apache web server to cache static content, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.