Marketing Advertises: Trying to avoid absolute path in URLs and use asp.net “~/” format-Collection of common programming errors

Hi,

I am trying to convert the image URLs in the Marketing advertises to relative URLs. That means instead of the following URL: (used in one of sample AdventureWorks ads):

/PublishingImages/SampleAd_Banner_grey.jpg

I use this:

~/PublishingImages/SampleAd_Banner_grey.jpg

And replace “~/” with the absolute URL at runtime. It brings many flexibilities to our application.

It works fine; however, it voids the “Advertising” cache can consumes lots of memory. Because on every request it takes one string.Replace on the strings that is returned from the “Advertising” cache (CDF API in Core)

·        Is there any better way to do this?

·        Am I missing any built-in feature of commerce server?

·        Can I just replace the “Advertising” cache contents with the alternate absolute path right after the cache is refreshed; the cache includes the processed urls afterward?

Thank you.