Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Greg Fyans 112 posts 271 karma points
    Sep 21, 2016 @ 08:59
    Greg Fyans
    0

    CDN Toolkit isn't using CDN url for media

    Hi Jeavon,

    First thing - great package!

    Second thing - My call to GetCropCdnUrl isn't returning a path to my CDN, but to the web domain.

    So when I set AzureCDNToolkit:UseAzureCdnToolkit to true, my media paths change from:

    /media/1480/myimage.jpg?anchor=center&mode=crop&rnd=131188587400000000

    To:

    http://mydomain.com/media/1480/myimage.jpg?anchor=center&mode=crop&rnd=131188587400000000

    So what have I done wrong? :) I'm pretty sure I've followed the set-up instructions correctly.

    My settings are:

    <add key="AzureCDNToolkit:Domain" value="http://mydomain.com/" />
    <add key="AzureCDNToolkit:CdnUrl" value="https://mycdn.azureedge.net" />
    
  • Jeavon Leopold 3000 posts 13161 karma points MVP 6x admin c-trib
    Sep 21, 2016 @ 09:05
    Jeavon Leopold
    0

    Hi Greg,

    Could you confirm that the ImageProcessor Azure Blob Cache plugin is installed and also check that it is creating blobs in the storage account?

    If that's all working fine, then could you check that the server can resolve it's own domain name, e.g. in a browser on the server can you access http://mydomain.com/media/1480/myimage.jpg?anchor=center&mode=crop&rnd=131188587400000000

    Jeavon

  • Greg Fyans 112 posts 271 karma points
    Sep 21, 2016 @ 10:04
    Greg Fyans
    0

    It's not creating blobs in the cache folder any more.

    It was as there were folders in there, but I've just deleted them all and it's not created any since.

    I'll run through the instructions again, clearly I've broken something.

  • Greg Fyans 112 posts 271 karma points
    Sep 21, 2016 @ 10:08
    Greg Fyans
    0

    That's strange, I removed the whole cache folder and it created my cache folder again, but no blobs in it.

    <?xml version="1.0" encoding="utf-8"?>
    <caching currentCache="AzureBlobCache">
      <caches>
        <cache name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365" browserMaxDays="7">
          <settings>
            <setting key="VirtualCachePath" value="~/app_data/cache" />
          </settings>
        </cache>
        <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache" maxDays="365">
          <settings>
            <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=[myaccountname];AccountKey=[myaccountkey]" />
            <setting key="CachedBlobContainer" value="cache" />
            <setting key="UseCachedContainerInUrl" value="true" />
            <setting key="CachedCDNRoot" value="https://mycdn.azureedge.net/" />
            <setting key="SourceStorageAccount" value="" />
            <setting key="SourceBlobContainer" value="" />
            <setting key="StreamCachedImage" value="false" />
          </settings>
        </cache>
      </caches>
    </caching>
    
  • Greg Fyans 112 posts 271 karma points
    Sep 21, 2016 @ 12:51
    Greg Fyans
    0

    Right, I basically reversed everything and started again. No idea what I did, but I clearly broke something.

    It's working now though.

    Got a few dodgy crops, but I think just need to run the crop healer on this site to fix them, so we're all good.

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft