1

I am updating a classic asp web application and looking at implementing application variables to save resources.

in the MS documentation, it mentions that "Application and Session variables require that clients have cookies enabled" (http://support.microsoft.com/kb/300883)

I get why session variables would need that, but why would application variables require that?

GWR
  • 1,878
  • 4
  • 26
  • 44
  • Nice question. Just out of interest what makes you think you'll save resources using Application Variables? Surely storing values at the application level will use more resource not less?? – user692942 Oct 28 '14 at 12:37
  • They are more or less constants - objects which would be exactly the same for all users, such as site settings from a DB table. No need for every request to call to the db to get the settings, for example. – GWR Oct 28 '14 at 16:21
  • Don't overuse Application variables i tend to use `#include` files instead especially for constants. – user692942 Oct 28 '14 at 17:49
  • Thanks for the advice. Can you point me to some documentation or reasoning which supports your advice? – GWR Oct 29 '14 at 01:09
  • 2
    Apart from 10+ years of experience of working with Classic ASP?, no not off the top of my head. A lot of it is trial and error and finding out for yourself. Application Variables exist for the life of the Web Application so common sense dictates they will have a resource usage penalty. For example don't store COM references instantiate them as needed, especially `ADODB.Connection`. Instead use them to store configuration values like connection strings and instantiate the `ADODB.Connection` as needed. It is entirely up to you whether to follow this advice, good luck. – user692942 Oct 29 '14 at 08:18
  • @Lankymart - completely agree with your example above. I was mainly going to use the application variable to store static site config settings, custom flag enums, etc. No COM objects for sure. – GWR Oct 29 '14 at 11:07
  • Then you have my blessing (not like you need it) ;-) – user692942 Oct 29 '14 at 12:31

0 Answers0