473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Default Membership Provider // Caching?

It looks like the default Membership Provider (and Role Provider) always
goes to the database to get its info.
(GetUsers, GetRoles, etc , etc).
I guess I'm going to roll my own, because I am going to need a cached
solution to avoid the database hits.
(My roles and users seldom/never change after a project rollout)

I wanted to ask in general (before I start the work of a custom membership
provider).

A. Am I right with my assumption? (no caching)
B. Is there some .config way to get caching from teh default providers that
I don't know about?
C. I really don't have any issue with ~~how the default ones work, just the
non caching. You think I might be able to use inheritance and just address
those issues?
D. If the above answers eventually lead to "roll your own", does anyone
know of a project/source showing a good "roll your own" solution.

I just got back from a long weekend trip in the car with my wife and 3 dogs.
So I'm a little on the "tuckered out" side today.
Thanks..............


Jun 19 '07 #1
4 4702
Hmm, 1 wife and 3 dogs? That could be part of the problem.
Anyway, the only caching I know of is the CacheRolesInCookie directive.
If you really think you need caching (and in fact you may not really need it
at all, so you should test first under load), then you are going to have to
roll your own.
Scott Guthrie has some nice links to sample custom providers on his blog.

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"sloan" wrote:
It looks like the default Membership Provider (and Role Provider) always
goes to the database to get its info.
(GetUsers, GetRoles, etc , etc).
I guess I'm going to roll my own, because I am going to need a cached
solution to avoid the database hits.
(My roles and users seldom/never change after a project rollout)

I wanted to ask in general (before I start the work of a custom membership
provider).

A. Am I right with my assumption? (no caching)
B. Is there some .config way to get caching from teh default providers that
I don't know about?
C. I really don't have any issue with ~~how the default ones work, just the
non caching. You think I might be able to use inheritance and just address
those issues?
D. If the above answers eventually lead to "roll your own", does anyone
know of a project/source showing a good "roll your own" solution.

I just got back from a long weekend trip in the car with my wife and 3 dogs.
So I'm a little on the "tuckered out" side today.
Thanks..............


Jun 19 '07 #2
look into using the "profile" object

http://www.codersource.net/published...n_asp_net.aspx
"sloan" <sl***@ipass.netwrote in message news:e%****************@TK2MSFTNGP04.phx.gbl...
It looks like the default Membership Provider (and Role Provider) always
goes to the database to get its info.
(GetUsers, GetRoles, etc , etc).
I guess I'm going to roll my own, because I am going to need a cached
solution to avoid the database hits.
(My roles and users seldom/never change after a project rollout)

I wanted to ask in general (before I start the work of a custom membership
provider).

A. Am I right with my assumption? (no caching)
B. Is there some .config way to get caching from teh default providers that
I don't know about?
C. I really don't have any issue with ~~how the default ones work, just the
non caching. You think I might be able to use inheritance and just address
those issues?
D. If the above answers eventually lead to "roll your own", does anyone
know of a project/source showing a good "roll your own" solution.

I just got back from a long weekend trip in the car with my wife and 3 dogs.
So I'm a little on the "tuckered out" side today.
Thanks..............


Jun 19 '07 #3

Public Class ModifiedSqlMembershipProvider
Inherits SqlMembershipProvider
http://www.devx.com/asp/Article/29256/0/page/3
It looks like if I'm mostly happy with the default provider, I can just
inherit from SqlMembershipProvider.

Well, that's what that URL says. I'm gonna check it out.

.........


"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comwrote in
message news:01**********************************@microsof t.com...
Hmm, 1 wife and 3 dogs? That could be part of the problem.
Anyway, the only caching I know of is the CacheRolesInCookie directive.
If you really think you need caching (and in fact you may not really need
it
at all, so you should test first under load), then you are going to have
to
roll your own.
Scott Guthrie has some nice links to sample custom providers on his blog.

Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"sloan" wrote:
It looks like the default Membership Provider (and Role Provider) always
goes to the database to get its info.
(GetUsers, GetRoles, etc , etc).
I guess I'm going to roll my own, because I am going to need a cached
solution to avoid the database hits.
(My roles and users seldom/never change after a project rollout)

I wanted to ask in general (before I start the work of a custom
membership
provider).

A. Am I right with my assumption? (no caching)
B. Is there some .config way to get caching from teh default providers
that
I don't know about?
C. I really don't have any issue with ~~how the default ones work, just
the
non caching. You think I might be able to use inheritance and just
address
those issues?
D. If the above answers eventually lead to "roll your own", does anyone
know of a project/source showing a good "roll your own" solution.

I just got back from a long weekend trip in the car with my wife and 3
dogs.
So I'm a little on the "tuckered out" side today.
Thanks..............


Jun 20 '07 #4
Here is some code to start (a future reader) out in the right direction:

I have a formal framework to cache data. So I had to leave that part out.
But the method are ensapsulated enough to get the idea.

If you're interested in my framework idea, check this out:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!125.entry

public class CachedSqlRoleProvider : SqlRoleProvider

{

private readonly string KEY_ALL_ROLES = "AllRolesKey";

private string[] GetCachedRoles()

{

//I have a Framework piece to cache data

//Implement your caching strategry here

return null;

}

private void CacheRoles(string[] roles)

{

//I have a Framework piece to cache data

//Implement your caching strategry here
}

public override string[] GetAllRoles()

{

string[] returnValues;
returnValues = this.GetCachedRoles();
//if there wasn't anything in the Cache, to use the base method to get a
fresh copy
if (null == returnValues)

{

//this will end up hitting the db
returnValues = base.GetAllRoles();

if (null != returnValues)

{

//we got them, cache them for next time

this.CacheRoles(returnValues);

}

}

return returnValues;

}

}
Jun 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: WB | last post by:
Hi, I am revamping my company's website with ASP.Net 2.0. In order to use our existing user data in our SQL 2000, I have written a custom membership provider. However, when I try to logon with...
3
by: Morgan | last post by:
Sorry for cross post, forgot to include aspnet in orinal... Thanks in advance for any assistance. I'm in the process of implementing custom RoleProvider & Membership Provider objects and have...
4
by: Bruno | last post by:
Hello, VS.net installs sql express as datastore for role/membership management. I don't like this! I'm not able to choose other databases like ms-access, in the Web Site Administration Tool ....
4
by: thomas | last post by:
Hello All, How to change the default Membership Provider during the runtime? I know I can reference any provider I want, e.g.: provider = Membership.Providers but the question is how to...
4
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality...
1
by: =?Utf-8?B?WmhlbmcgQ2hlbg==?= | last post by:
I have an aspnetdb database sitting in different domain with the web server. To authenticate a user and populate membership provider, WCF is used. However, I have no idea how to pass the membership...
6
by: Jonathan Wood | last post by:
Although this will be a challenge at my level of ASP.NET knowledge, I'm thinking I should implement my own membership provider class. Looking over the methods I must implement, a number of...
2
by: Andy B | last post by:
I have a database with asp.net membership inside it. How would I use it for 2 or more web applications at the same time?
3
by: dm3281 | last post by:
Hello -- I need to write an ASP.NET 2.0 application for our clients to use to login and verify file transmissions. Each client will need their own logon, in addition to a way to assign each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.