Note that there are some explanatory texts on larger screens.

plurals
  1. PODiskCache plugin imageresizer in MVC3
    text
    copied!<p>For my MVC project (Image Server Application), I cannot do caching using imageresizer. I can access my images like this and the image source could be either FileSystem/Database (Dependency injeciton) : </p> <p>localhost/images/123.jpg?width=500 <br> localhost/images/123?width=500</p> <p>I have an MVC 3 project with routes like </p> <pre><code> routes.RouteExistingFiles = true; routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("favicon.ico"); routes.MapRoute( "ImagesWithExtension", // Route name "images/{imageName}.{extension}/", // URL with parameters new { controller = "Home", action = "ViewImageWithExtension", imageName = "", extension = "", id = UrlParameter.Optional } // Parameter defaults ); routes.MapRoute( "Images", // Route name "images/{imageName}/", // URL with parameters new { controller = "Home", action = "ViewImage", imageName = "", id = UrlParameter.Optional } // Parameter defaults ); </code></pre> <p>I have two controllers to deal with images public ActionResult ViewImageWithExtension(string imageName, string extension) {} public ActionResult ViewImage(string imageName) {}</p> <p>The caching is done when the URL is like : localhost/images/123.jpg?width=500 and the image source is FileSystem<br> localhost/images/123?width=500 Cache not working image source is Filesystem<br> localhost/images/123.jpg?width=500 Cache not working, image source DB<br> localhost/images/123?width=500 Cache not working , image source DB</p> <p>My web config is like this:</p> <pre><code>&lt;configSections&gt; &lt;section name="resizer" type="ImageResizer.ResizerSection" /&gt; &lt;/configSections&gt; &lt;resizer&gt; &lt;!-- Unless you (a) use Integrated mode, or (b) map all reqeusts to ASP.NET, you'll need to add .ashx to your image URLs: image.jpg.ashx?width=200&amp;height=20 Optional - this is the default setting --&gt; &lt;diagnostics enableFor="AllHosts" /&gt; &lt;pipeline fakeExtensions=".ashx" /&gt; &lt;DiskCache dir="~/MyCachedImages" autoClean="false" hashModifiedDate="true" enabled="true" subfolders="32" cacheAccessTimeout="15000" asyncWrites="true" asyncBufferSize="10485760" /&gt; &lt;cleanupStrategy startupDelay="00:05" minDelay="00:00:20" maxDelay="00:05" optimalWorkSegmentLength="00:00:04" targetItemsPerFolder="400" maximumItemsPerFolder="1000" avoidRemovalIfCreatedWithin="24:00" avoidRemovalIfUsedWithin="4.00:00" prohibitRemovalIfUsedWithin="00:05" prohibitRemovalIfCreatedWithin="00:10" /&gt; &lt;plugins&gt; &lt;add name="DiskCache" /&gt; &lt;/plugins&gt; &lt;/resizer&gt; </code></pre> <p>Am I doing something wrong or Imageresizer doesnt support this scenario ? If not any good plugin to use disk based image cahce ?</p> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload