cookieless session, "~" operator and client-side cashing problems

T

Tomasz J

Hello developers,

My custom control allows for specifying paths to images it uses.
In those paths I want to be able to use the "~" app root operator, so my app
works correctly with virtual paths.

So, rendering the control I have to convert the "~" app-rooted paths to a
website-rooted paths using WebControl.ResolveUrl() or a similar method.

And here is the problem:
If cookieless sessions are used, paths resolved in such way include session
ids, like (S(prfybe55sw30b155y4w22pfp) as a part of the client-visible path.
As a result client browser is unable to effectively cache images - every
time new session is created images are being downloaded over and over
again - because their observed paths change.

I think the best solution is to convert the "~" app-rooted path to a
website-rooted path, but without the session id part. Are there any
simple/standard solutions, besides resorting to Regex?

Thanks for any hints and/or comments,

Tomasz
 
S

Steven Cheng

Hi Tomasz,

As for the Session State, if you're using cookieless mode, the id is
necessary and url is the only place we can hold it. Yes, you're right that
the client caching may be affected due to the changable sessionID. However,
as long as the user session not expire, the sessionID should remain the
same value and the page will be cached at client-side during that period.

For the following things you mentioned:

===========
I think the best solution is to convert the "~" app-rooted path to a
website-rooted path, but without the session id part. Are there any
simple/standard solutions, besides resorting to Regex?
==============

what's the exact problem you want to address by converting the "~" path? As
far as I know, all the server-side controls(markup) can interpret this path
correctly. For website based path, if your application's physical path(from
site root) will not quite change, you can use "/xxxx" like path which is
based from IIS site.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top