Copied to clipboard

Flag this post as spam?

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


  • Jakob Kristensen 36 posts 169 karma points
    Dec 16, 2016 @ 10:15
    Jakob Kristensen
    0

    Image Processor not caching images locally...

    Hello Umbraco

    I have an issue with remote images over imageprocessor.web, it doesnt seem to cache the images out the box, the browser caches it but the server doesnt.

    I have installed the plugin successfully and can crop and do all i need to to, except when using remote.axd it still makes a request when i ctrl + f5 and tries to retrive a new image, this obviously slows down the load of the website.

    This is not an azure application just a simple IIS site.

    What am i doing wrong? :)

    Settings:

    <caching currentCache="DiskCache">
      <caches>
        <cache name="DiskCache" type="ImageProcessor.Web.Caching.DiskCache, ImageProcessor.Web" maxDays="365" browserMaxDays="30">
          <settings>
            <setting key="VirtualCachePath" value="~/app_data/cache" />
          </settings>
        </cache>
      </caches>
    </caching>
    
    <?xml version="1.0" encoding="utf-8"?>
    <processing preserveExifMetaData="false" fixGamma="false" interceptAllRequests="false" allowCacheBuster="true">
      <presets>
      </presets>
      <plugins>
        <plugin name="Alpha" type="ImageProcessor.Web.Processors.Alpha, ImageProcessor.Web" />
        <plugin name="AutoRotate" type="ImageProcessor.Web.Processors.AutoRotate, ImageProcessor.Web" enabled="true" />
        <plugin name="BackgroundColor" type="ImageProcessor.Web.Processors.BackgroundColor, ImageProcessor.Web" enabled="true" />
        <plugin name="Brightness" type="ImageProcessor.Web.Processors.Brightness, ImageProcessor.Web" />
        <plugin name="Contrast" type="ImageProcessor.Web.Processors.Contrast, ImageProcessor.Web" />
        <plugin name="Crop" type="ImageProcessor.Web.Processors.Crop, ImageProcessor.Web" enabled="true" />
        <plugin name="DetectEdges" type="ImageProcessor.Web.Processors.DetectEdges, ImageProcessor.Web" />
        <plugin name="EntropyCrop" type="ImageProcessor.Web.Processors.EntropyCrop, ImageProcessor.Web" />
        <plugin name="Filter" type="ImageProcessor.Web.Processors.Filter, ImageProcessor.Web" />
        <plugin name="Flip" type="ImageProcessor.Web.Processors.Flip, ImageProcessor.Web" />
        <plugin name="Format" type="ImageProcessor.Web.Processors.Format, ImageProcessor.Web" enabled="true" />
        <plugin name="GaussianBlur" type="ImageProcessor.Web.Processors.GaussianBlur, ImageProcessor.Web">
          <settings>
            <setting key="MaxSize" value="22" />
            <setting key="MaxSigma" value="5.1" />
            <setting key="MaxThreshold" value="100" />
          </settings>
        </plugin>
        <plugin name="GaussianSharpen" type="ImageProcessor.Web.Processors.GaussianSharpen, ImageProcessor.Web">
          <settings>
            <setting key="MaxSize" value="22" />
            <setting key="MaxSigma" value="5.1" />
            <setting key="MaxThreshold" value="100" />
          </settings>
        </plugin>
        <plugin name="Halftone" type="ImageProcessor.Web.Processors.Halftone, ImageProcessor.Web" />
        <plugin name="Hue" type="ImageProcessor.Web.Processors.Hue, ImageProcessor.Web" />
        <plugin name="Mask" type="ImageProcessor.Web.Processors.Mask, ImageProcessor.Web">
          <settings>
            <setting key="VirtualPath" value="~/images/imageprocessor/mask/" />
          </settings>
        </plugin>
        <plugin name="Meta" type="ImageProcessor.Web.Processors.Meta, ImageProcessor.Web" />
        <plugin name="Overlay" type="ImageProcessor.Web.Processors.Overlay, ImageProcessor.Web">
          <settings>
            <setting key="VirtualPath" value="~/images/imageprocessor/overlay/" />
          </settings>
        </plugin>
        <plugin name="Pixelate" type="ImageProcessor.Web.Processors.Pixelate, ImageProcessor.Web" />
        <plugin name="Quality" type="ImageProcessor.Web.Processors.Quality, ImageProcessor.Web" enabled="true" />
        <plugin name="ReplaceColor" type="ImageProcessor.Web.Processors.ReplaceColor, ImageProcessor.Web" />
        <plugin name="Resize" type="ImageProcessor.Web.Processors.Resize, ImageProcessor.Web" enabled="true">
          <settings>
            <setting key="MaxWidth" value="5000" />
            <setting key="MaxHeight" value="5000" />
          </settings>
        </plugin>
        <plugin name="Rotate" type="ImageProcessor.Web.Processors.Rotate, ImageProcessor.Web" />
        <plugin name="RotateBounded" type="ImageProcessor.Web.Processors.RotateBounded, ImageProcessor.Web" />
        <plugin name="RoundedCorners" type="ImageProcessor.Web.Processors.RoundedCorners, ImageProcessor.Web" />
        <plugin name="Saturation" type="ImageProcessor.Web.Processors.Saturation, ImageProcessor.Web" />
        <plugin name="Tint" type="ImageProcessor.Web.Processors.Tint, ImageProcessor.Web" />
        <plugin name="Vignette" type="ImageProcessor.Web.Processors.Vignette, ImageProcessor.Web" />
        <plugin name="Watermark" type="ImageProcessor.Web.Processors.Watermark, ImageProcessor.Web" />
      </plugins>
    </processing>
    
    <?xml version="1.0" encoding="utf-8"?>
    <security>
      <cors>
        <whitelist>
          <!--
          Demo: Adding a url will send cors headers to that requesting url.
                "*" acts as a universal selector.
          -->
          <add url="*"/>
        </whitelist>
      </cors>
      <services>
        <service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />
        <!--Disable the LocalFileImageService and enable this one when using virtual paths. -->
        <!--<service name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
          <settings>
            <setting key="Container" value=""/>
            <setting key="MaxBytes" value="8194304"/>
            <setting key="Timeout" value="30000"/>
            <setting key="Host" value="http://yourhost.com/"/>
          </settings>
        </service>-->
        <service  prefix="remote.axd"  name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="4194304000" />
            <setting key="Timeout" value="30000" />
            <setting key="Protocol" value="http" />
          </settings>
          <whitelist>
            <add url="WHITELISTED DOMAIN YES IT IS FILLED NORMALLY"/>
          </whitelist>
        </service>
      </services>
    </security>
    
  • Craig Richards 17 posts 75 karma points
    Aug 04, 2017 @ 00:04
    Craig Richards
    0

    Hi Jakob,

    Did you manage to get to the bottom of this as I seem to be having the same issue?

    Regards, Craig

  • James Jackson-South 489 posts 1747 karma points c-trib
    Aug 07, 2017 @ 06:55
    James Jackson-South
    0

    When asking questions it's usually useful to add version numbers, example requests, any useful info that can help with diagnosis.

  • John Bergman 483 posts 1132 karma points
    Aug 04, 2017 @ 14:49
    John Bergman
    0

    Try creating a cache folder called "cache" inside your app_data folder; I noticed that if the folder is missing, it doesn't get created.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Aug 07, 2017 @ 06:54
    James Jackson-South
    0

    ImageProcessor creates the folder on demand.

  • malcin 1 post 73 karma points
    Aug 12, 2018 @ 15:42
    malcin
    2

    Hello, I am having exactly the same problem.

    It looks like the umbraco doesn't even care about the cache at all - the image is cached properly in the app_data/cache folder but when I reload site all images that are already in cache are recreated. I can check this by looking on the modified date windows attribute of the cached image and this is always the date of last request.

    Any idea? I am using the newest (7.11) umbraco version.

  • Jakob Kristensen 36 posts 169 karma points
    Sep 04, 2018 @ 11:07
    Jakob Kristensen
    0

    Sorry for late reply.

    We ended up upgrading to 7.7 and it worked, other than that we pulled down the image processor repo and added that instead of the nuget package made changes to the part where it regenerates and made sure it would not regenerate another image, cant be more specific since this code is gone after upgrading so try to upgrade umbraco above 7.6

Please Sign in or register to post replies

Write your reply to:

Draft