I want to cache the thumbs because the images I am resizing are around 1-3 MBs each and it takes forever to load a page of thumbnails so I want to cache the thumbnails. Is this possible or do I need to take a new approach? Thanks!

Below is my current code:

<cfimage action="read" source="#dir.DIRECTORY#\#dir.name#" name="ImageObject" />
<cfimage action="resize" source="#ImageObject#"	width="115" height="89" name="ImageObject" />
<cfimage action="writetobrowser" source="#ImageObject#" style="margin-right:4px;" />

Recommended Answers

All 3 Replies

CF9 has does have vfs. But image processing is time consuming. No avoiding it. It's usually better to just create thumbnails once and save them on disk. Resizing every time a user requests a page wastes a lot of resources.

CF9 has does have vfs. But image processing is time consuming. No avoiding it. It's usually better to just create thumbnails once and save them on disk. Resizing every time a user requests a page wastes a lot of resources.

VFS looks very nice, too bad I'm on CF8. Since everything is done on the fly, manually making thumbs isn't really an option. Might there be any scripts out there for generating thumbs? I keep coming up empty handed on google searches..

Well .. I don't mean literally by hand ;-) Just that you'd have 2 versions of the images: full sized and thumbnail.
You'd still use the same CF code. But you'd only do it once and save them. It can be a batch script that cfloops through all of your images. Or code triggered when some event occurs, like an image is uploaded.

It's just too process intensive to run a resize every time somebody requests or refreshes the page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.