skjaiswal1991 / smart-lencioni-image-resizer

Automatically exported from code.google.com/p/smart-lencioni-image-resizer
GNU General Public License v3.0
0 stars 0 forks source link

Add folder depth #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Enhancement: Please add a possibility to set a folder depth

$folderDepth = 3;
/rendered/1/12/123/134abodasdasdad
/rendered/1/43/143/1438aAjdasdmaOl

à la Cache Lite.

Great job with the script!
I've modified it for my needs, to only allow preconfigured size-aliases
/xl/myHouse.jpg where xl reads an conf-array. all other requests go 404.

Original issue reported on code.google.com by Mar...@gmail.com on 2 May 2011 at 2:23

GoogleCodeExporter commented 8 years ago
I am not familiar with Cache Lite. Could you please explain the folder depth 
concept?

Original comment by joe.lencioni on 2 May 2011 at 6:00

GoogleCodeExporter commented 8 years ago
Cache Lite is for caching rendered page elements on disk. Similar to SLIR it 
puts the md5 hashed filenames in a cache folder. However, the folder tends to 
get huge which makes it nearly impossible to navigate through it's files or 
sometimes even delete them (argument quantity limit on linux).

To resolve this, cache lite allows you to enable subfolders in the cache 
folder. the subfolder structure is based on the first n chars of the cache 
files.

if a file is named '6219xiasdh72khUao" the application will put it and look for 
it in
..../rendered/6/62/621/6219xiasdh72khUao
the example assumes a depth of 3.

depth of 1: .....rendered/6/6219xiasdh72khUao
depth of 5: .....rendered/6/62/6219/6219x/6219xiasdh72khUao

I quickly ported the main functionality over to SLIR (it's just 3 lines here 
and there), but when it came to symlinks I had to give up ;)

Original comment by Mar...@gmail.com on 2 May 2011 at 7:11