On Sep 11, 3:25 am, gearb0x <[EMAIL PROTECTED]> wrote:
> Hey guys,
<snip>
> Any configurable images are stored in the db (i don't need anyone
> telling me this is wrong) so as such, when loading a page with lots of
> images stored in the DB, there are lots of requests going to the
> server for cake stuff.
Hi gearb0x,
It sounds to me as if you know what the problem is but just don't want
to address it.
Preamble: Why store them in the db, serving images with php is slow
enough (although often unavoidable) without tying up your db
connection aswell. If the image files are sizable and numerous it is
an obvious cause for what you describe.
If you identify your bottle neck as being communication with the db
(look at your active processes on the db and the machine in general
when it's frozen) you shouldn't need any further encouragement that
images in the db is wrong in this case ;). You could find if you are
resizing on the fly or whatever that it's the image manipulation code
that is slowing you down, how about caching these images in the
webroot and instead of echo $this->Image->field('content´); doing $ths-
>redirect->(´/img/´. $username . ´/´ . md5($currentUserName.
$somethingConfigurable) . ' /' . $imageFilename, null, true); you
could route /img/ to a controller function to handle missing files and
either generate and redirect to the current url or output a missing
image graphic or whatever.
If you identify your bottleneck as something else (emphasis on the
"you identify" ;) ) put "move images out of db" just below "fix xyz"
on your todo list :).
hth,
AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---