We are using a Table for Profiles and have the profiles set up , etc.
If a user buys a membership product then we need to change his profile and make him a member so that the cart can be evaluated as a member and member pricing will apply.
Is it possible to add a new profile or update the profiles using ProfileSystem API and setting the Member flag at run time before we run pipeline and expect the pipeline / discounting engine to recognize this profile without refreshing the cache for the profile.
Thanks

Targetting Profile
MMerchant
We will be using Web Farm without sticky sessions, Is there any setting to not cache the profiles.
Also if we decide not to cache the profile, we may have a perfomance hit, but considering that we use profiles only for running the basket pipeline, we do not use any of the profile objects in commerce server,and our profile object is really a userid and a Membership level, would it be too much of an impact to let it load from the database every time
Thanks
Tom De Cort
msdate,
I don't think there's any way to configure the profiles system cache. (It's not an available cache to configure in Web.config). If you are using ASP.Net membership and the Content Selection Framework within your site, these have a dependency on Commerce Server's profile system as well.
If you're not using sticky sessions, you can possibly use a client cookie to refresh the cache on your web server. For example, if the client registers on Server A at 4:00 PM, save a cookie with the current date and time the user's machine. If the client then connects to Server B, check the client's cookie data against the cache date of the server. If the date time on the cookie is greater than that cache datetime on the server, expire the server's cache. This might give you a performance hit, but no worse of a hit then you'd take if you altogether stopped using profile caching.
I'm actually not even sure if it's possible to expire the profile cache, but that's a pretty common mechanism for expiring caches.
lucerias
Hello,
Yes, this is just the sort of usage we envisioned for the profile system and discount targeting. You would typically create a user profile property called "Membership Level" and use a site term to contain the current membership level of the user. Then use a discount eligibility requirement expression to give a discount when the membership level is set to "Member". Later when you add "Gold Star Member" or some new membership level, this scheme is very easily extensible.
You can set this profile property at runtime. The only thing to be aware of with respect to caching is that the profile cache is local to a Web server. So if you are using a Web farm without sticky load balancing you will need to employ some means to keep the caches consistent across the Web servers so that behavior is consistent within a session.
See the topic Using Profiles in a Web Farm Scenario in the docs for more details on this.
Regards
-David