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

  • SEARCH
  • Home
  • 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 806463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:14:50+00:00 2026-05-15T00:14:50+00:00

For my global variables and data I find myself in a dilema as to

  • 0

For my global variables and data I find myself in a dilema as to whether to use HttpApplicationState or Static variables – What’s the best approach?

This document states that one should use static variables over httpapplicationstate:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312607

However, one thing I like about HttpApplicationState (and System.Web.Caching.Cache), is that one can easily enumerate the entries and select which items to remove (I’ve created a global CacheManager.axd for this purpose), whereas I don’t believe there’s an easy way with Static variables (and even then it’s not clear what to do to “re-initialise” them), without recycling the app pool.

Any suggestions on a neat general-purpose way to handle and manage global objects?

Thanks, Mark.

  • 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-05-15T00:14:51+00:00Added an answer on May 15, 2026 at 12:14 am

    Your instincts are correct. Use System.Web.Caching. The built-in cache management takes care of all the heavy lifting with respect to memory allocation and expiring stale or low priority objects.

    Make sure to use a naming convention, for your cache keys, that makes sense down the road. If you start relying heavily on caching, you’ll need to be able to target/filter different cache keys by name.

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

Sidebar

Related Questions

I need to make this data variable global: $.ajax({ url: get_data.php, cache: false, dataType:
I always hear using global variables are dangerous. Does this apply to Drupal? Take
I am using one file to send data to global variables in a globals
Lets consider two cases: 1.) Static global variables. When i generate map file i
Possible Duplicate: Global Variables in Cocoa/Objective-C? problem with declare a global variable in objective
The discussion around global variables and their misuse seems to hold a certain dogmatic
I'm using global variables to pass around a response from a AJAX call: window.response
Possible Duplicate: Global variables in R ad the beginning of the file I wrote:
I have a global variables that I am using as a default variable. Depending
I'm running into trouble accessing global variables when I make an AJAX call to

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.