Copied to clipboard

Flag this post as spam?

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


  • Planx42 14 posts 55 karma points
    Jan 03, 2016 @ 20:23
    Planx42
    0

    Using ImageProcessor.AzureBlobCache not working to serve cached images

    I am trying to follow this video tutorial - https://www.youtube.com/watch?v=5Qp-ZGaKFaY

    To use ImageProcessor.AzureBlobCache with Azure table storage. The requirements were to install the UmbracoFileSystemProviders.Azure which I have done. This plugin works by itself and when switching to my azure storage account it correctly created my media folder and all of my images are being rendered with the ImageProcessor properly after copying all local files from /media/ to the storage account.

    Now I would like to configure a CDN from the instructions at 19:00 minutes of this video but have not had success following the steps. After installing the ImageProcessor.AzureBlobCache plugin, I setup my table storage account in the cache.config file under /Config/imageprocessor/cache.config to look like the following:

    <?xml version="1.0" encoding="utf-8"?><caching currentCache="AzureBlobCache"><caches>
    <cache name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365">
      <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=STORAGE_ACCOUNT_NAME;AccountKey=_STORAGE_ACCOUNT_KEY" />
        <setting key="CachedBlobContainer" value="cache" />
        <setting key="CachedCDNRoot" value="http://MY-CDN-NAME.azureedge.net/" />
        <setting key="SourceStorageAccount" value="" />
        <setting key="SourceBlobContainer" value="" />
        <setting key="StreamCachedImage" value="false" />
      </settings>
    </cache></caches>
    

    But it looks like in the video they already have created the cache folder in the storage account. Is this supposed to get automatically created by the plugin because it does not? I am wondering how to properly configure this as in the video the cache folder already is created with the proper images and just works but it is not explained how this is setup. Not sure if I should create this cache folder manually, and then how would the images get copied over each time one is added to the website from the media folder?

    Appreciate any extra advice on how to configure my Azure CDN using the above plugins to serve from the cache folder.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Jan 04, 2016 @ 05:30
    James Jackson-South
    101

    Hi there,

    The Azure cache should be creating the folder for you upon image request.

    I'll need to ask a couple of questions if I may to be able to get things working for you.

    1. Are you using the same storage account/credentials for the cache as you use for the UmbracoFileSystemProviders.Azure plugin?
    2. Are you using the CloudImageService as specified in the documentation?
    3. Could you supply a sample url that you are requesting an image with?

    It all should kick in automatically once everything is installed when you use a url such as:

    /media/1234/my-image.jpg?width=250
    

    Once processed and cached the server will then perform a 302 redirect of the request to the CDN.

    Cheers

    James

  • Planx42 14 posts 55 karma points
    Jan 05, 2016 @ 01:32
    Planx42
    1

    Hi,

    I got it working. Not really sure what was different but I just redid everything and made sure the configuration of my cache.config file matched the settings you've specified here: http://imageprocessor.org/imageprocessor-web/plugins/azure-blob-cache/

    It's working now. Thanks a lot for the advice, and for creating the plugin!

  • James Jackson-South 489 posts 1747 karma points c-trib
    Jan 05, 2016 @ 05:52
    James Jackson-South
    0

    That's great news! Glad I was able to help :)

Please Sign in or register to post replies

Write your reply to:

Draft