I was looking at hosting the files uploaded in the umbraco media library on a CDN however i have ran into a bit of an issue. I need to change the urls for all media items to cdn.blah.com/media/xxx/yyy.jpg, however i don't fancy going through all the xslt files changing the get media area to include the new host, and should i change this host in the future have to do this all over again. Is there anyway to extend umbraco to have a media base url setting? Or would i need to modifiy the source to achieve this?
Hi. As a matter of fact existing media types seem to be bound to store physical files in the local filesystem. I suppose that the proper way to achieve your goal would be just creating your own custom media type.
The package above are great but a little bit OTT for my requirement, the CDN automatically pulls the images when they are requested from the main server.
So i only need to change the www.aaa.com/media/1234/test.jpg to cdn.aaa.com/media/1234/test.jpg
Which means i just need a media path prefix type variable.
Has any achieved this, modifiying the core? or using a plugin?
I've just thought - perhaps the simplest choice could be merely modify img's urls on the client with javascript? Sure, a bit clumsy approach, but if you just need a quick result then why not.
You could also use the urlrewriting functions built into umbraco, or the UrlRewrite addon for IIS. I will try to dig up an example but the basics of it is that you write a regular expression for the url to match and a replacement regex to map to. I have done this before with one of my sites and it worked nicely. I redirected all requests for www.mysite.com/tests to tests.mysite.com.
Media content delivery network
Hi,
I was looking at hosting the files uploaded in the umbraco media library on a CDN however i have ran into a bit of an issue. I need to change the urls for all media items to cdn.blah.com/media/xxx/yyy.jpg, however i don't fancy going through all the xslt files changing the get media area to include the new host, and should i change this host in the future have to do this all over again. Is there anyway to extend umbraco to have a media base url setting? Or would i need to modifiy the source to achieve this?
THanks
John
Hi. As a matter of fact existing media types seem to be bound to store physical files in the local filesystem. I suppose that the proper way to achieve your goal would be just creating your own custom media type.
I have been using the universal media picker http://our.umbraco.org/projects/backoffice-extensions/universal-media-picker with the Amazon S3 adapter and it works to server my media from S3 instead of from my main web server.
The package above are great but a little bit OTT for my requirement, the CDN automatically pulls the images when they are requested from the main server.
So i only need to change the www.aaa.com/media/1234/test.jpg to cdn.aaa.com/media/1234/test.jpg
Which means i just need a media path prefix type variable.
Has any achieved this, modifiying the core? or using a plugin?
Thanks
John
I've just thought - perhaps the simplest choice could be merely modify img's urls on the client with javascript? Sure, a bit clumsy approach, but if you just need a quick result then why not.
You could also use the urlrewriting functions built into umbraco, or the UrlRewrite addon for IIS. I will try to dig up an example but the basics of it is that you write a regular expression for the url to match and a replacement regex to map to. I have done this before with one of my sites and it worked nicely. I redirected all requests for www.mysite.com/tests to tests.mysite.com.
I think i might have to go with the 301 idea, didn't even think of using them, in an ideal world i'd like the url to correct.
is working on a reply...