This patch add feature into imagecache to serve images from different subdomain, this increase front end performance (multiple download) and serve image with cookieless connection. It also add UI to manage this feature.
Actually use can configure only 3 subdomain (number can easy increase by change IMAGECACHE_MAX_SUBDOMAIN), but user can not change it from interface; I think user can add more subdomain and lost performance by multple DNS resolving. This functionality (select number of maximum subdomain) is easy to add.

NOTE: To assicurate cookieless images request use www.www.yourdomain.tpl into $cookies_domain (yes, double WWW, Drupal by default remove the first www).

Comments

mavimo’s picture

I've create a separate module to do this (overriding theme function), this patch can be removed from queue (if you prefer don't add this feature into imagecache core module).

rjbrown99’s picture

The CDN integration module will also do this.

mavimo’s picture

ok, but this is a really simple version to CDN module ;)

srobert72’s picture

Subscribe

mavimo’s picture

raintonr’s picture

Please ignore... I was just repeating commend above about CDN :(

sorvin’s picture

Version: 6.x-2.0-beta9 » 6.x-2.0-beta10
Category: task » support

I've installed the addon module that mavimo linked on comment #5 but I do not see an area enter the sub domain that I wish to use under the configuration tab. Any help would be appreciated.

kkkatsumoto’s picture

There is a bug in imagecache_subdomain.module.

Change:
variable_set('imagecache_subdomain_number', 3)

To:
variable_get('imagecache_subdomain_number', 3)

kkkatsumoto’s picture

You still neds to fix one thing:

First check in function _imagecache_get_subdomain($file_name = NULL) to:

if (!variable_get('imagecache_subdomain_enable', FALSE) || is_null($file_name)) {

mavimo’s picture

Fixed ont github repo. tks!

Mercury500’s picture

this sounds very interesting.

Tested on a dev site. 6.14. Used files from github as of 1 hour ago. It installs fine, but doesn't seem to do anything.

No cache set on site. I flushed imagecache.

Hummm.

I even inputted a fake subdomain to try to "break" the imagecached images, nope.

Could you give a brief settings/install overview? And yes, I know there's not much settings...

I used "http://www.xxxxxxx.com" as the subdomain, then tried "http://images.xxxxxxx.com" to break.

Is that the correct format?

Thanks.

sorvin’s picture

Status: Reviewed & tested by the community » Needs review

This does not appear to work. Like Mercury500, I tried different urls and it continues to save the images in the default location.

mavimo’s picture

Fixed a theming error into and add INSTALL information.

Test on a clean Drupal + CCK + FileField + ImageField + ImageCache and it work.

Thenks to all for your feedback.

craigmc’s picture

Please consider submitting the imagecache_subdomain module directly to d.o. I have a CVS account if you want me to post it

mavimo’s picture

@craigme: I'll plublish it in DO into next day.

UPDATE: http://drupal.org/project/imagecache_subdomain I'll relase after some new test.

stevestanco’s picture

drewish’s picture

Status: Needs review » Closed (won't fix)