{"id":3941,"date":"2014-03-30T06:27:40","date_gmt":"2014-03-30T06:27:40","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/marketing-advertises-trying-to-avoid-absolute-path-in-urls-and-use-asp-net-format-collection-of-common-programming-errors\/"},"modified":"2014-03-30T06:27:40","modified_gmt":"2014-03-30T06:27:40","slug":"marketing-advertises-trying-to-avoid-absolute-path-in-urls-and-use-asp-net-format-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/marketing-advertises-trying-to-avoid-absolute-path-in-urls-and-use-asp-net-format-collection-of-common-programming-errors\/","title":{"rendered":"Marketing Advertises: Trying to avoid absolute path in URLs and use asp.net &#8220;~\/&#8221; format-Collection of common programming errors"},"content":{"rendered":"<p>Hi,<\/p>\n<p>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):<\/p>\n<p>\/PublishingImages\/SampleAd_Banner_grey.jpg<\/p>\n<p>I use this:<\/p>\n<p>~\/PublishingImages\/SampleAd_Banner_grey.jpg<\/p>\n<p>And replace \u201c~\/\u201d with the absolute URL at runtime. It brings many flexibilities to our application.<\/p>\n<p>It works fine; however, it voids the \u201cAdvertising\u201d cache can consumes lots of memory. Because on every request it takes one string.Replace on the strings that is returned from the \u201cAdvertising\u201d cache (CDF API in Core)<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Is there any better way to do this?<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Am I missing any built-in feature of commerce server?<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Can I just replace the \u201cAdvertising\u201d cache contents with the alternate absolute path right after the cache is refreshed; the cache includes the processed urls afterward?<\/p>\n<p>Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 \u201c~\/\u201d with the absolute URL at runtime. It brings many flexibilities to our application. It works fine; however, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3941","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3941"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3941\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}