[symfony-users] Re: Serving images from a static server/CDN
I think you can just indicate the absolute url as the first argument of the helper function and use the "absolute" option setting it to true. Martino On Mon, Mar 2, 2009 at 10:57 AM, Christian Schaefer wrote: > > > Hi all, > > is there a way to tell the image_tag() helper to use a different > domain than the application? > > I am creating a lot of images in symfony and write them to disk > afterwards to do it only once. > > yslow still tells me to serve them from a CDN and I want to do this. > only I don't fancy to change all image_tag() call for this.. > > hint? > > > cheers > /christian > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Serving images from a static server/CDN
well I could do that but then I would have to do it everywhere I use the image_tag() helper. even if I set a constant or something I would still have to change all my code for it which is sort of against the idea of helpers is it not? On 2 Mrz., 11:09, Martino Piccinato wrote: > I think you can just indicate the absolute url as the first argument > of the helper function and use the "absolute" option setting it to > true. > > Martino > > On Mon, Mar 2, 2009 at 10:57 AM, Christian Schaefer wrote: > > > Hi all, > > > is there a way to tell the image_tag() helper to use a different > > domain than the application? > > > I am creating a lot of images in symfony and write them to disk > > afterwards to do it only once. > > > yslow still tells me to serve them from a CDN and I want to do this. > > only I don't fancy to change all image_tag() call for this.. > > > hint? > > > cheers > > /christian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Serving images from a static server/CDN
You can override any symfony helper, although it's not exactly elegant (you have to copy and override all helpers in a given group): http://www.symfony-project.org/book/1_0/07-Inside-the-View-Layer Look at the section "Adding your own helpers" You could even use this to implement a round-robin over several CDN domains, to speed things up even further by increasing parallel downloads. Cheers, Andreas caefer schrieb: > > well I could do that but then I would have to do it everywhere I use > the image_tag() helper. even if I set a constant or something I would > still have to change all my code for it which is sort of against the > idea of helpers is it not? > > On 2 Mrz., 11:09, Martino Piccinato wrote: >> I think you can just indicate the absolute url as the first argument >> of the helper function and use the "absolute" option setting it to >> true. >> >> Martino >> >> On Mon, Mar 2, 2009 at 10:57 AM, Christian Schaefer wrote: >> >>> Hi all, >>> is there a way to tell the image_tag() helper to use a different >>> domain than the application? >>> I am creating a lot of images in symfony and write them to disk >>> afterwards to do it only once. >>> yslow still tells me to serve them from a CDN and I want to do this. >>> only I don't fancy to change all image_tag() call for this.. >>> hint? >>> cheers >>> /christian > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Serving images from a static server/CDN
oh I know that but I wanted to point out that a centralized and configurable behaviour is needed. the same thing is discussed here: http://www.mail-archive.com/symfony-users@googlegroups.com/msg11593.html so inho apart from absolute urls there should be a setting sf_image_host that defaults to the current applications hosts. /christian On 2 Mrz., 18:55, andreash wrote: > You can override any symfony helper, although it's not exactly elegant > (you have to copy and override all helpers in a given group): > > http://www.symfony-project.org/book/1_0/07-Inside-the-View-Layer > > Look at the section "Adding your own helpers" > > You could even use this to implement a round-robin over several CDN > domains, to speed things up even further by increasing parallel downloads. > > Cheers, > Andreas > > caefer schrieb: > > > > > well I could do that but then I would have to do it everywhere I use > > the image_tag() helper. even if I set a constant or something I would > > still have to change all my code for it which is sort of against the > > idea of helpers is it not? > > > On 2 Mrz., 11:09, Martino Piccinato wrote: > >> I think you can just indicate the absolute url as the first argument > >> of the helper function and use the "absolute" option setting it to > >> true. > > >> Martino > > >> On Mon, Mar 2, 2009 at 10:57 AM, Christian Schaefer > >> wrote: > > >>> Hi all, > >>> is there a way to tell the image_tag() helper to use a different > >>> domain than the application? > >>> I am creating a lot of images in symfony and write them to disk > >>> afterwards to do it only once. > >>> yslow still tells me to serve them from a CDN and I want to do this. > >>> only I don't fancy to change all image_tag() call for this.. > >>> hint? > >>> cheers > >>> /christian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Serving images from a static server/CDN
On Mon, 2 Mar 2009, Christian Schaefer wrote: > is there a way to tell the image_tag() helper to use a different > domain than the application? > > I am creating a lot of images in symfony and write them to disk > afterwards to do it only once. > > yslow still tells me to serve them from a CDN and I want to do this. > only I don't fancy to change all image_tag() call for this.. We use a configuration constant and all our image_tag() calls use the variable. (Yes, you need to change all the image_tag calls the first time you do this but then you only need to change it in one place if it ever needs to move somewhere else like a CDN). -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---