views:

25

answers:

1

Does the ASP.NET SQL Profile Provider use caching? I mean if I pull data from the profile for a user will it hit the DB for each request?

I'm looking for a setting or any information on this. I had thought I read it would use cookies but I can't find this now.

Edit:

http://msdn.microsoft.com/en-us/library/aa478953.aspx describes process as

When called by SqlProfileProvider.GetPropertyValues, aspnet_Profile_GetProperties performs the following actions:

  1. Queries the aspnet_Applications table to convert the application name input to it into an application ID.
  2. Queries the aspnet_Users table to convert the user name input to it into a user ID.
  3. Queries the aspnet_Profile table for the PropertyNames, PropertyValuesString, and PropertyValuesBinary fields for the specified user.
  4. Updates the user's last activity date in the aspnet_Users table with the current date and time.
A: 

From MSDN

When your application runs, ASP.NET creates a ProfileCommon class, which is a dynamically generated class that inherits the ProfileBase class. The dynamic ProfileCommon class includes properties created from the profile property definitions you specify in your application configuration. An instance of this dynamic ProfileCommon class is then set as the value of the Profile property of the current HttpContext and is available to pages in your application.

It appears that the Profile object is attached to the current HttpContext of the request. So, unless you create a new HttpContext, the profile data is loaded and stored here on first request.

Tommy
@Tommy This link describes the process http://msdn.microsoft.com/en-us/library/aa478953.aspx. It does not mention caching.
Curtis White
But it does. The profile for that particular user is attached to the current HttpContext. Those values are not all stored in a cookie (which is good, since cookies do have limits to the amount of info that can be stored within them).
Tommy