When imagecache constructs the URL for the image derivative it uses the core url() function. If you pass the array element 'alias' => TRUE to the $options array optional parameter for url() you can bypass the need for an alias lookup.
Correct me if I'm making too great of an assumption but should it not be the case that any imagecache URL is NOT an aliased path but always the path to the physical file (existing or to be lazy generated on first request) and so we would never need to do an alias lookup?
I understand that it might not always be the case for some uses perhaps however if it IS a valid case then I think bypassing the alias lookup will help performance on pages with many imagecache images.
Patch adds the relevant 'alias' parameter to the array passed to url() in imagecache_create_url().
| Comment | File | Size | Author |
|---|---|---|---|
| bypss_alias_lookup.patch | 541 bytes | jaydub |
Comments
Comment #1
lex0r commentedIf there is no need for an image URL alias, why do you make an additional query to database that is not needed at all?
I would call this a bug, since the module does unnecessary resource consumption that affects performance.
Comment #2
lex0r commentedComment #3
fizk commentedReopen if you can show performance tests, that would be great. This could potentially break sites so we'd need to know if its worth changing.
Comment #3.0
fizk commentedspelling correction