Copied to clipboard

Flag this post as spam?

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


This forum is in read only mode, you can no longer reply
  • Cristhian Amaya 52 posts 423 karma points
    Feb 16, 2016 @ 11:18
    Cristhian Amaya
    0

    Azure Blob Cache 404 on remote processing

    Hi

    I'm making a demo using Slimsy and Azure Blob Cache, but when I try to do any image processing remotely I get a 404 error.

    This is my cache.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <caching currentCache="AzureBlobCache">
      <caches>
        <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache" maxDays="365">
          <settings>
            <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=http;AccountName=[AccountName];AccountKey=[AccountKey]" />
            <setting key="CachedBlobContainer" value="slimsydemocache" />
            <setting key="UseCachedContainerInUrl" value="false" />
            <setting key="CachedCDNRoot" value="http://slimsydemocdn.azureedge.net/" />
            <setting key="SourceStorageAccount" value="" />
            <setting key="SourceBlobContainer" value="" />
            <setting key="StreamCachedImage" value="false" />
          </settings>
        </cache>
      </caches>
    </caching>
    

    This is my security.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <security>
      <services>
        <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />
        <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="4194304" />
            <setting key="Timeout" value="3000" />
            <setting key="Protocol" value="http" />
          </settings>
          <whitelist>
            <add url="http://slimsydemocdn.azureedge.net/" />
          </whitelist>
        </service>
      </services>
    </security>
    

    The url I'm using to transform remotely: http://slimsydemo.azurewebsites.net/remote.axd/slimsydemocdn.azureedge.net/media/1004/people-q-c-640-480-7.jpg?width=200

    And as you can see the image actually exists: http://slimsydemocdn.azureedge.net/media/1004/people-q-c-640-480-7.jpg

    I already checked that my blob container is public.

    Any ideas about what is missing?

    Cheers.

    Edit:

    I'm using Umbraco 7.3.7, ImageProcessor 2.3.3, ImageProcessor.Web 4.5.3, ImageProcessor.Web.Config 2.2.5 and ImageProcessor.Web.Plugins.AzureBlobCache 1.0.8

  • James Jackson-South 489 posts 1747 karma points c-trib
    Feb 16, 2016 @ 13:21
    James Jackson-South
    0

    Hi Cristhian,

    So you're storing your media files in blob storage as well as the cached images?

    If so what IFileSystem provider implementation are you using?

    James

  • Cristhian Amaya 52 posts 423 karma points
    Feb 16, 2016 @ 13:25
    Cristhian Amaya
    0

    Hey James,

    No, I'm not storing the images in blob storage. I'm storing them on the site and using an Azure CDN.

  • Cristhian Amaya 52 posts 423 karma points
    Feb 16, 2016 @ 18:45
    Cristhian Amaya
    0

    If I understand correctly how the package works, when I go to a url like: http://slimsydemo.azurewebsites.net/media/1002/animals-q-c-640-480-2.jpg?width=100 it should redirect me to the cdn version of that image. Instead of doing that I get a 404. I checked the container and the images are there.

    I know I'm missing something but I just don't see what it is.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Feb 17, 2016 @ 00:15
    James Jackson-South
    0

    The package should allow you to request a local media file as follows

    /media/1002/animals-q-c-640-480-2.jpg?width=100 
    

    This would then be processed and cached in blob storage. That works normally out of the box.

    What I have noticed in your setup is that the successful request url

    http://slimsydemocdn.azureedge.net/media/1004/people-q-c-640-480-7.jpg
    

    contains the relative path media and is pointed at a cdn.

    http://slimsydemocdn.azureedge.net/
    

    Though the url to your domain is

    http://slimsydemo.azurewebsites.net
    

    How have you managed that if your media folder is not stored in blob storage?

    If you are using locally stored media the paths to your media files should be relative to your domain with no cdn involved.

    e.g.

    http://slimsydemo.azurewebsites.net/media/1004/people-q-c-640-480-7.jpg
    

    Your cdn should then only be associated with the blob account that contains your image cache container with your in-site request url getting redirected to something like.

    http://slimsydemocdn.azureedge.net/9/3/b/f/a/7/93bfa72533e7d20d60fbabcba0566ef93897d3e1.jpg
    

    (I plucked the hash out of thin air there. It's not representative of your real final url)

    Something is definitely incorrect about the way you have set up your Azure account.

  • Cristhian Amaya 52 posts 423 karma points
    Feb 17, 2016 @ 12:24
    Cristhian Amaya
    0

    The CDN source is the website, that's why the urls are equivalent between the site and the CDN.

    I'll try to point my CDN to the cache folder and see how it goes. If that doesn't work then I'll try to store all the media in blob storage.

  • Cristhian Amaya 52 posts 423 karma points
    Feb 17, 2016 @ 18:53
    Cristhian Amaya
    100

    So, after pointing my CDN to the cache blob container and changing the setting UseCachedContainerInUrl to true on the cache.config everything works as expected.

    Thank you James for pointing me out on the right direction.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Feb 18, 2016 @ 00:54
    James Jackson-South
    1

    Ah excellent! So glad you got it worked out. :)

    Could you mark one of the responses as an answer so we can close the thread.

    Cheers!

Please Sign in or register to post replies

Write your reply to:

Draft