Closed (fixed)
Project:
Parallel
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2010 at 06:56 UTC
Updated:
11 May 2010 at 20:00 UTC
ImageCache module generates preset images on the fly.
If I enabled Parallel modules with existing ImageCache images, all works correctly.
But if I upload new image, call from the image URL transformed by Parallel module doesn't allow ImageCache module to operates and generates preset image.
ImacheCache preset images are only generated if called with native URL and not transformed one generates by Parallel module.
Comments
Comment #1
mikeytown2 commentedDepends on how your setup. I use parallel with imagecache. How are you using parallel?
Comment #2
srobert72 commentedI use for CSS, JS and images files.
As I said, it works on all already generated images. But not on new ones.
I use Parallel to deliver images from another domain with no cookies.
To generate new ImageCache preset mages I must call their URL on primary domain once and then after I can use their URL on cookieless domain.
Comment #3
mikeytown2 commentedYou should be able to run PHP on the other domains. This is actually a problem for SEO if not setup correctly
http://drupal.org/node/597178#comment-2735418
Are you using something other then apache to serve files on these other domains? You can use this patch for image cache which will generate the images on node creation
http://drupal.org/node/374202#comment-2799612 - Use it with the rules module.
Comment #4
srobert72 commentedI would prefer Apache solution. But I'm a little bit surprise with 301 redirect.
If I configured second domain to deliver cookieless images, it's not to permanently redirect them back to original domain. In this case I could just disable Parallel no ?
Second domain should redirect to original one just at first time, if image doesn't exist.
All other requests can be sent to second cookieless domain.
Comment #5
mikeytown2 commentedhtaccess solution sounds interesting... question: are you using the same htaccess file for the main domain as well as the cookie-less domain?
Comment #6
mikeytown2 commentedBased off of my SEO work I think this can easily be done... Untested ATM & should work with/without Drupal's htaccess rules.
307 is a temporary redirect
Comment #7
mikeytown2 commentedComment #8
srobert72 commentedI use different htaccess for original (Drupal) domain and cookieless one.
Cookieless one only delivers images, CSS and JS generated by Drupal but it uses no PHP.
Cookieless domain only uses those Drupal directories :
/misc
/modules
/sites
/themes
Cookieless domain is on same Apache server and uses symbolic links for those directories to point to Drupal.
No need to copy files, they can be used when generated.
I will test your solution in cookieless htaccess and will tell result.
Thank you.
Comment #9
srobert72 commented#6
Those htaccess rules don't work, I have 404 error.
@mikeytown2
Is it working for you ?
Comment #10
mikeytown2 commentedSince your using a different htaccess file for your cookieless domain, try this. This will break clean urls on a normal Drupal box, but should work in your case since it's a different htaccess file.
Comment #11
srobert72 commentedMaybe it's evident, but should be precised for everyone (I forgot it).
Those rules must be included with
RewriteEngine onelse it doesn't work.This code is OK in my case :
Main Drupal site : www.example.com
Cookieless domain (to deliver images) : cdn3.cookielessexample.com
EDIT cdn3.cookielessexample.com/.htaccess :
First call, request is redirected (status=307) to Drupal main site so that imagecache can generate image.
Other calls (status=200) and no more redirect.
I think it's a good solution.
No intrusion code in other modules or other sites configurations.
We have just to edit .htaccess for cookieless domain.
Thank you very much @ mikeytown2 !!
Comment #12
mikeytown2 commentedWould you mind testing the first set of rules I gave you with
RewriteEngine onin place? Still curious about those, since those will not interfere with drupal's htaccess rules. Thanks for seeing that and fixing it on your own :)Comment #13
srobert72 commentedOK I will test it.
Just a precision, we can't use same domain for cookieless images.
Subdomain "cdn3" keeps cookies from main domain "example.com".
To configure cookieless you MUST use another domain, with "cdn3" subdomain name if you want (or any other subdomain name as you like). You must have TWO different domains.
Without that you lost all benefit from using Parallel module as it doesn't change nothing from using main Drupal URLs.
Comment #14
srobert72 commentedYour first set of rules works. But I would rewrite it as follows:
Main Drupal site : www.example.com
Cookieless domain (to deliver images) : cdn3.cookielessexample.com
EDIT cdn3.cookielessexample.com/.htaccess :
And in my opinion, second light set of rules is sufficient.
JS and CSS files aren't gererated on file request. They are generated and their URL are wrote in source code on page request. So requesting them from Parallel always work.
ImageCache is another workflow. Images are generated on file request. Requesting them from Parallel cookieless domain doesn't work because PHP isn't called and URL isn't intercepted by ImageCache.
So in my opinion best solution is :
Main Drupal site : www.example.com
Cookieless domain (to deliver images) : cdn3.cookielessexample.com
EDIT cdn3.cookielessexample.com/.htaccess :
Comment #15
mikeytown2 commentedComment #16
jcisio commentedIncorrect ;) By default Drupal cookie remove one level, that mean cdn.example.com and www.example.com has the same cookie, but s1.cdn.example.com and www.example.com don't.
My other solution for the redirect, not using RewriteEngine (so that it's easier to modify to use with other web server, and a little faster, why check -f thousands of time for a rare condition?). In cdn.example.com:
In redirect.pl:
Comment #17
heyyo commentedquestion removed. resolved :-)
Comment #18
jcisio commentedWell, there are too many solutions ;)