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
  • Gareth Wright 32 posts 101 karma points c-trib
    Feb 23, 2017 @ 14:48
    Gareth Wright
    0

    Azure CDN: Querystring actions not working

    Hi,

    I'm using the following to setup a Azure CDN in Umbraco 7.5.9.

    • ImageProcessor: 2.5.2
    • ImageProcessor.Web: 4.8.2
    • ImageProcessor.Web.Config: 2.30
    • ImageProcessor.Web.Plugins.AzureBlobCache: 1.3.0
    • UmbracoFileSystemProviders.Azure: 0.5.8 -beta.

    I have Umbraco uploading and displaying images from the CDN. However whenever I use a querystring parameter, such as ?width=50&height=50 it doesn't work.

    Here are my configuration files:

    cache.config:

    <?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" browserMaxDays="0" folderDepth="6" trimCache="true">
          <settings>
            <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=XXXXX;AccountKey=XXXXX;" />
            <setting key="CachedBlobContainer" value="cache" />
            <setting key="UseCachedContainerInUrl" value="true" />
            <setting key="CachedCDNRoot" value="https://XXXXX.azureedge.net/" />
    
            <setting key="SourceStorageAccount" value="" />
            <setting key="SourceBlobContainer" value="" />
            <setting key="StreamCachedImage" value="false" />
          </settings>
        </cache>
    
      </caches>
    </caching>
    

    security.config:

    <?xml version="1.0" encoding="utf-8"?>
    <security>
      <services>
        <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />
    
        <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
          <settings>
            <setting key="Container" value="media" />
            <setting key="MaxBytes" value="31457280" />
            <setting key="Timeout" value="30000" />
            <setting key="Host" value="https://XXXX.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="4194304" />
            <setting key="Timeout" value="30000" />
            <setting key="Protocol" value="https" />
          </settings>
          <whitelist>
            <add url="http://XXXX.azureedge.net/" />
          </whitelist>
        </service>
      </services>
    </security>
    

    FileSystemProviders.config:

    <?xml version="1.0"?>
    <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://XXXXX.blob.core.windows.net/"/>
          <add key="connectionString"
               value="DefaultEndpointsProtocol=https;AccountName=XXXXX;AccountKey=XXXXX;"/>
          <add key="maxDays" value="365"/>
          <add key="useDefaultRoute" value="true"/>
          <add key="usePrivateContainer" value="false"/>
        </Parameters>
      </Provider>
    </FileSystemProviders>
    

    I've literally tried every configuration change... any help would be great!

    Many thanks

  • Gareth Wright 32 posts 101 karma points c-trib
    Feb 23, 2017 @ 14:55
    Gareth Wright
    0

    Just to note, if I revert back to local storage it works.

  • Gareth Wright 32 posts 101 karma points c-trib
    Feb 23, 2017 @ 16:49
    Gareth Wright
    100

    Think I've fixed it:

       <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
      <settings>
        <setting key="Container" value="media" />
        <setting key="MaxBytes" value="31457280" />
        <setting key="Timeout" value="30000" />
        <setting key="Host" value="https://XXXX.blob.core.windows.net/" />
      </settings>
    </service>
    

    Removing media/ on the host value, fixes the problem... documentation is a little confusing...

Please Sign in or register to post replies

Write your reply to:

Draft