Page 1 of 1

Complex and annoying CDN problem.

Posted: Sat Mar 21, 2009 8:37 am
by panic!
OK, bare with me on this.

I'm making a site for a client who insist on their site being delivered via a content delivery network (caching on multiple servers all over the world, like CacheFly or similar services.).

Here's the problem.

The site is developed on a dev server, let's say http://development.client.com/site/ then the content of the site is periodically read by the CDN/caching service and made available via http://www.client.com.

On the dev site I have <base href="http://development.client/site/"/> generated and set by the framework/cms so that when viewing on servers I don't have to do any messing around with URLS and it just works perfectly.

Obviously when the CDN/caching service reads http://development.client.com/site/ to be put on http://www.client.com it reads the base href as http://development.client.com/site/ and all the links on the real site all point to the dev version of the site, which is obviously wrong.

Anyone got any ideas?

Re: Complex and annoying CDN problem.

Posted: Sat Mar 21, 2009 9:14 am
by panic!
ok I figured out how I'm gonna solve it if anyone cares.

I've changed my /etc/hosts to point client.com to development.client.com

sweet.

Re: Complex and annoying CDN problem.

Posted: Sat Mar 21, 2009 2:50 pm
by Benjamin
Doesn't that defeat the purpose of not having a single point of failure?

Re: Complex and annoying CDN problem.

Posted: Mon Mar 23, 2009 10:14 am
by panic!
The hosts entry so I can access and use the CMS. Unless every customer who views the site edits their hosts file too they will view the site through the CDN.

Re: Complex and annoying CDN problem.

Posted: Mon Mar 23, 2009 10:41 am
by JAB Creations
panic! wrote:OK, bare with me on this.
I dunno, will the mods tolerate nudity on the forums? 8O

Sorry that I don't have anything constructive to say but good luck. :P

Re: Complex and annoying CDN problem.

Posted: Tue Mar 24, 2009 11:15 am
by panic!
oh yeah BEAR..my bad.

I sorted it anyway ;)

Re: Complex and annoying CDN problem.

Posted: Fri Mar 27, 2009 10:54 am
by josh
Did you abstract your URL generation, or at least put the base URL in a configuration file