问题
We are using ImageResizer plugin to resize images on the fly along with diskCache plugin for caching.
<diskCache dir="~/imagecache" autoClean="false" hashModifiedDate="true" enabled="true"
subfolders="32" cacheAccessTimeout="15000" asyncWrites="false" syncBufferSize="10485760" />
<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" />
We want to mention the number of images per folder. However the options are available in cleanupStrategy. Right now we do not want to set the clean up stragegy. Can somebody advise how can I set targetItemsPerFolder & maximumItemsPerFolder without clean up stuff?
Thanks in advance..
回答1:
Only use the attributes that you're actually changing.
<cleanupStrategy targetItemsPerFolder="400" maximumItemsPerFolder="1000" />
Better yet, don't mess with carefully tuned defaults at all. Adjust the subfolders
count on the diskcache
element instead, as recommended everywhere in the documentation.
来源:https://stackoverflow.com/questions/22555699/imageresizer-diskcache-cleanupstrategy