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 8124853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:36:18+00:00 2026-06-06T06:36:18+00:00

I found this article who explain how to use cache items expiration to make

  • 0

I found this article who explain how to use cache items expiration to make a scheduled job for ASP.NET applications without using any scheduler or windows services.
It is really interesting for me!

In the article, the author is using HttpContext.Current.Cache to add an item. So when item expires in cache a treatment can be done..

But in his article he’s making a ‘false’ request from the server to himself to have access to HttpContext to reach Cache and add item again when the previous expires.
I tried to use System.Web.Hosting.HostingEnvironmentto access Cache without any HttpContext (so no need to make a ‘DummyRequest’) and it seems working.

Is there something I don’t understand or know about this cache? Is the HttpContext and the HostingEnvironment cache different? I think this is the same thing, intellisense describe the twos like the ‘application cache’ without differences.

  • 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. Editorial Team
    Editorial Team
    2026-06-06T06:36:20+00:00Added an answer on June 6, 2026 at 6:36 am

    They are the same and both call the HttpRuntime.Cache – From the source code:

    public static Cache System.Web.Hosting.HostingEnvironment.Cache
    {
        get
        {
            return HttpRuntime.Cache;
        }
    }
    

    and

    public Cache System.Web.HttpContext.Cache
    {
        get
        {
            return HttpRuntime.Cache;
        }
    }
    

    Also this is state on the MSDN:

    HostingEnvironment.Cache
    Gets the Cache instance for the current application.
    Namespace: System.Web.Hosting
    Assembly: System.Web (in system.web.dll)
    ref: http://msdn.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.cache(VS.85).aspx

    HttpContext.Cache Property

    Gets the Cache object for the current application domain.
    Namespace: System.Web
    Assembly: System.Web (in System.Web.dll)
    ref: http://msdn.microsoft.com/en-us/library/system.web.httpcontext.cache.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this article on how to manipulate the rendering sequence of asp.net controls.:
I found this on net in google search and see article here: http://www.thatcssguy.com/limit-your-divs/ See
I found this article on using Sql Cache Dependency with Linq2SQL. http://www.dotnetcurry.com/ShowArticle.aspx?ID=263 is it
I found this article about how to insert, update and delete using linq pad
I'm learning about WCF and found this article on a simple WCF example. In
I found this older article how-to-monitor-the-computers-cpu-memory-and-disk-usage-in-java and wated to ask, if there is something
I recently found an article online that told me about this: RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1&section=$2
I read This article and i found it interesting. To sum it up for
I found this function that does an AWESOME job (IMHO): http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl /** * Get
I found this article on using Git in Dropbox as a secondary repository. The

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.