Greetings,
Thank you for the excellent module, I have only encountered one issue. After applying the core and the imagecache patches, all existing content is correctly being served via our CDN (Akamai). However, when attempting to view a imagecache preset file that does not currently exist on the file system, a broken link is displayed. Changing the domain on the broken image back to our server (ie. replacing cdn1.*.* with www.*.*), the image is correctly created by imagecache and is then viewable via the CDN link.
Is this the proper behavior? Is there any way to pass the request from the CDN to the server to generate the image and not just display a broken link? I have seen the imagecache patch that pre-builds all preset images in advance, but would prefer to only generate them as needed and serve them correctly through the CDN.
Thanks in advance!
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | cdn-862880-14.patch | 517 bytes | sandrewj |
Comments
Comment #1
fleshgrinder commentedSubscribing, same problem here. This is not limited to the CDN module, it's also a problem which occurs with the Simple CDN module. By patching or overwriting the
imagecache_create_url()function no presets will be processed.I changed the category to “bug report” and the priority to “major”. In my opinion this is a major key-feature of the CDN module and therefore has to work properly. I'm investigating further to find a solution for this, maybe I can help a bit.
Comment #2
fleshgrinder commentedOkay, I found a way that works for my configuration.
imagecache.moduleComment #3
wim leersAlthough I was pretty sure this couldn't be true because I've tested it in the past, I actually created a whole new Drupal 6.19 site + Image + ImageCache + ImageAPI + CDN integration. It does work just fine. Or at least, I can't reproduce it in my simple setup, maybe this problem is only popping up because you're combining these modules with some other, buggy modules?
I need to see hard proof that it's failing. I.e. if you want this to be fixed, then you'll have to provide me with a test site to which I have full SSH/SFTP access on which the problem is already being reproduced.
Comment #4
chrism2671 commentedHi Wim,
I've managed to reproduce this very same problem on my site using Voxel's origin pull CDN. I'm not sure what the cause is- I found that I can fix the problem for individual images by calling them using the server URL rather than the CDN URL- this generates the image, and then the CDN URL works, but when the same request comes from the CDN for some reason it doesn't seem to parse it.
I cannot for the life of me figure out why it would do this.
Comment #5
chrism2671 commentedHang on. I have a thought- Fleshgrinder + deadrich - are you using varnish as well? I am. It may well be that varnish is playing a part here...
Comment #6
wim leersThat's very likely indeed…
Comment #7
chrism2671 commentedCan somebody try pointing their CDN at the non-varnish port? (8080 for most people). I think this might fix it but unfortunately Voxel's crap CDN doesn't permit the entering of an origin URL with a port number.
Comment #8
chrism2671 commentedOK I have successfully experimented and found that it does indeed appear to varnish that is causing the grief. If you set your CDN to pull from apache directly, bypassing varnish (i.e. on port 8080), this problem goes away.
Comment #9
wim leersGreat to know! I documented this right away. Thanks for pulling through and getting back to me!
http://drupal.org/cvs?commit=416680
Comment #10
wim leersWoops, that should've been "Origin Pull CDN" and not "Push CDN".
http://drupal.org/cvs?commit=416682
Comment #12
ywarnier commentedJust to report that the patch given in #2 has effectively fixed the problem with uploading images with Varnish + Drupal 6 + ImageCache 2, but I also had to remove the check on ImageCache as hinted here: http://drupalcode.org/project/cdn.git/blobdiff/60609b47275c6af77f8600fcb....
Thanks guys, this was really starting to drive me mad!
Comment #13
ywarnier commentedReporting again, I have been using Varnish + D6.22 + ImageCache for about a month now. At the beginning, I had applied the patches indicated here as reported in the previous comment.
However, after a while, the original problem appeared again (mostly when people started editing in different places) with no explicable reason.
This problem is also related to comments #52 and #72 of report http://drupal.org/node/570132.
Comment #52 in particular mentions a hack which calls the imagecache_build_derivative() again inside the code indicated here, but doesn't give any code snippet.
After long hours of trial (enabling and disabling this incredible CDN module on a production site during quiet hours), I have been able to verify that the problem is the ImageCache module does not generate the corresponding resized image, even with the patch mentioned as a first comment here, so I reproduced the imagecache_build_derivative() patch and that worked like a charm. Here is the modified code. I'm not submitting it as a patch because I think it's both an ugly patch (it just add one check instead of fixing the problem in the first place - but I couldn't find that first place where it happens) and it's mostly an imagecache patch which only happens when enabling CDN. Even then, it works so I applied it on several production sites (running several thousands visits per hour).
Comment #14
Gabriel R. commentedBringing this back and assigning to ImageCache.
Comment #15
sandrewj commentedpatch to generate image if the url is altered. probably will affect performance somewhat since it will check if the file exists every time it generates the url.
Comment #16
wim leersIs this still a problem when using version 2.0 beta 12 of the ImageCache module? It supports the CDN module natively (without requiring a patch).
Comment #17
wim leersClosing due to lack of response.
Comment #18
aleksey.tk commentedI still have this problem and i'm using latest release candidate for D6.
I have Varnish too, can anyone explain where to apply patch #13 to get things work?
Comment #19
aleksey.tk commentedComment #20
aleksey.tk commentedSorry, it was a problem in my custom htaccess rules.