Copied to clipboard

Flag this post as spam?

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


  • Erik Foppen 20 posts 62 karma points
    Feb 06, 2018 @ 10:02
    Erik Foppen
    0

    Stange behavior of Azure Blob Cache

    Hi,

    I'm implementing Azure Media Storage and Cache following the instructions here: https://our.umbraco.org/Documentation/Umbraco-Cloud/Set-Up/Media/.

    But that doesn't work. My image is not processed (cropped) and cached.

    This is my setup:

    FileSystemProviders.config:

    <?xml version="1.0" encoding="utf-8"?>
    <FileSystemProviders>
      <!-- Media -->
      <Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure">
        <Parameters>
          <add key="containerName" value="media"/>
          <add key="rootUrl" value="https://adelantezorggroep2018.blob.core.windows.net/"/>
          <add key="connectionString"
            value="DefaultEndpointsProtocol=https;AccountName=adelantezorggroep2018;AccountKey=[accountkey]" />
          <add key="maxDays" value="7"/>
          <add key="useDefaultRoute" value="media"/>
          <add key="usePrivateContainer" value="false"/>
        </Parameters>
      </Provider>
    
    </FileSystemProviders>
    

    imageprocessing/security.config:

    <?xml version="1.0" encoding="utf-8"?>
    <security>
      <services>
        <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
          <settings>
            <setting key="Container" value="media" />
            <setting key="MaxBytes" value="18194304" />
            <setting key="Timeout" value="60000" />
            <setting key="Protocol" value="https" />
            <setting key="Host" value="https://adelantezorggroep2018.blob.core.windows.net/media/" />
          </settings>
    
        </service>
        <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="18194304" />
            <setting key="Timeout" value="60000" />
            <setting key="Protocol" value="http" />
          </settings>
          <whitelist>
            <add url="https://adelantezorggroep2018.blob.core.windows.net/" />
            <add url="https://adelantezorggroep2018.azurewebsites.net/" />
            <add url="https://adelantezorggroep2018-test.azurewebsites.net/" />
            <add url="http://localhost" />
            <add url="http://127.0.0.1" />
          </whitelist>
        </service>
      </services>
    </security>
    

    imageprocessing/cache.config:

    <caching currentCache="AzureBlobCache">
      <caches>
        <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache"
               maxDays="365" browserMaxDays="7" folderDepth="6" trimCache="true">
          <settings>
            <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=adelantezorggroep2018;AccountKey=[accountkey]"/>
            <setting key="CachedBlobContainer" value="cache"/>
            <setting key="UseCachedContainerInUrl" value="false"/>
            <setting key="CachedCDNRoot" value="https://adelantezorggroep2018.blob.core.windows.net/"/>
            <setting key="CachedCDNTimeout" value="1000"/>
            <setting key="SourceStorageAccount" value=""/>
            <setting key="SourceBlobContainer" value=""/>
            <setting key="StreamCachedImage" value="false"/>
          </settings>
        </cache>
      </caches>
    </caching>
    

    When I look in Fiddler I see strange things:

    enter image description here

    Maybe someone has seen this behavior of Blob Cache before and can point in a direction?

    Any help is muchly appreciated!!

    Best regards! Erik

  • Jeavon Leopold 2966 posts 12870 karma points MVP 4x admin c-trib
    Feb 06, 2018 @ 11:25
    Jeavon Leopold
    0

    Hi Erik,

    You should remove the "media/" from your Host setting.

    It should be

        <setting key="Host" value="https://adelantezorggroep2018.blob.core.windows.net/" />
    

    Jeavon

  • Erik Foppen 20 posts 62 karma points
    Feb 06, 2018 @ 12:23
    Erik Foppen
    0

    Hi Jeavon,

    thanks for your reply. I removed it, but no luck unfortunately. It was only there because I was trying different configs.

    This is happening on localhost. I'm setting up a staging env in Azure to see if it also happens there...

    Erik

  • Jeavon Leopold 2966 posts 12870 karma points MVP 4x admin c-trib
    Feb 06, 2018 @ 16:40
    Jeavon Leopold
    0

    I would suggest you try to switch the cache back to disk and see if it works...

  • Erik Foppen 20 posts 62 karma points
    Feb 07, 2018 @ 10:47
    Erik Foppen
    0

    hmm.. the disk cache isn't working either:

    <cache name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365">
      <settings>
        <setting key="VirtualCachePath" value="~/app_data/cache" />
      </settings>
    </cache>
    

    the cache folder is created but stays empty.

    The thing I don't get is this: in Fiddler I see a GET /media/https://815307/hdyo6rr3kqk-scott-webb.jpg HTTP/1.1

    ??

    GET /media/https://815307/hdyo6rr3kqk-scott-webb.jpg

    Where normally I see a 302 redirect. This is from another website with the same config:

    this is normal behavior

  • Erik Foppen 20 posts 62 karma points
    Feb 07, 2018 @ 13:31
    Erik Foppen
    0

    So now it seems I have isolated the problem... I think...

    remote.axd is never hit (always returns a 404, also with correct whitelisted domains, also with legacy call).

    Any way to further investigate this?

  • Chris Clancy 39 posts 106 karma points
    Feb 12, 2018 @ 16:03
    Chris Clancy
    0

    I'm having a similar problem using Umb 7.8.0

    I have copied the exact same config details from a working site running on 7.6.12 but I could not get images to go into the blob cache folder.

    The following packages were installed:

    • ImageProcessor.Web.Plugins.AzureBlobCache (v1.4)
    • UmbracoAzureBlobStorageProvider
    • UmbracoFileSystemProviders.Azure

    The solution for me was to roll back to ImageProcessor.Web.Plugins.AzureBlobCache v 1.3.1

    Everything now works as expected.

  • Erik Foppen 20 posts 62 karma points
    Feb 15, 2018 @ 10:52
    Erik Foppen
    0

    Hi Chris,

    thanks for your reply, glad you got it working again.

    Sadly this isn't solving the problem for me.

    Next step for me is to run Umbraco from source together with ImageProcessor from source. Hopefully debugging gives me some more info

Please Sign in or register to post replies

Write your reply to:

Draft