Knowledgebase

CDN for dynamic content?

Posted by CyberAlien, 03-10-2017, 03:43 AM
I'm looking for something like CDN, but: 1. It should host files on multiple servers across continents rather than work as proxy to one origin server 2. It should be able to run PHP script. No database, just simple PHP script that generates dynamic content All CDN providers seem to only act as proxies to origin server, but that's useless because content is dynamically generated, so most requests would be simple redirects to origin server. Cloud hosting providers seems to be nothing but pointless buzzword for usual hosting. Are there such services?

Posted by ursa-musculus, 03-10-2017, 05:39 AM
Is the site dynamic only in the sense of "generated by a script", or is it also dynamic in the sense of "changes with some frequency" (because of self-hosted comments, new blog posts, or whatever it is?) If it's the latter, your task is more complex, as having multiple servers generating the same content would also need a way of keeping them in sync. If it's the former, you probably want AnyCast DNS, which is where the same IP is advertised by multiple networks around the world, so traffic simply goes to the end-node that is (topographically, not geographically - which is what you want) nearest. That would basically mean you're running your own CDN.

Posted by CyberAlien, 03-10-2017, 05:42 AM
There is no database, so almost no syncing, apart from updating to new version. Its a rather simple script that generates JavaScript or JSON files based on URL parameters.

Posted by JSCL, 03-10-2017, 05:56 AM
Speak to Dejan at BunnyCDN.

Posted by ursa-musculus, 03-10-2017, 05:57 AM
... and yet not enough cacheable content, so that a regular CDN will only add round-trip times by having to grab from the origin each time. I'd have thought AnyCast is your only option - you need multiple hosting accounts that you can set up identically, with a single domain name that resolves to the nearest each time. That's precisely what AnyCast is. That probably means you're looking at VPS - I've not come across shared hosting that does that. BuyVM offers free AnyCast with 3 POPs (west coast, east coast, europe). There are others, but not that I've used. If you really can't use a caching CDN, your options will be more limited.

Posted by ursa-musculus, 03-10-2017, 05:59 AM
Ooh. Would they let someone run their PHP scripts on the POP node servers?

Posted by CyberAlien, 03-10-2017, 06:00 AM
Thanks. Yep, that exactly is the issue. Too many variables, so caching is pointless.

Posted by JSCL, 03-10-2017, 06:02 AM
I've just started using them and having talked to Dejan about certain needs this project has, we were talking about AnyCast and a bunch of other stuff. He seems completely flexible in being able to help suit any situation, I'm quite impressed.

Posted by JesseG-Host, 03-10-2017, 05:51 PM
I was going to say the same thing, Bunny CDN-13 data centers, Key CDN-25 datacenters, CDN 77- 32 data centers. Any of which should fit what your requesting.

Posted by ursa-musculus, 03-10-2017, 06:05 PM
Ah, but how many of those let you run your own PHP scripts actually on the POP node servers (from your direct experience of them as providers)?

Posted by JesseG-Host, 03-10-2017, 06:33 PM
They all pull from the nearest edge server POP at data center, but you would have to ask them directly. CDN 77 lets you choose which data centers specifically.

Posted by ursa-musculus, 03-11-2017, 04:33 AM
That's true. But the OP is looking for something more specific. Most CDNs serve the visitor from the nearest edge server to the visitor. The edge server either serves the page from its cache, or retrieves the page from the actual server that runs the website and generates the content. The OP is looking for a CDN where he actually installs his PHP source code onto the edge servers, so that they never have to retrieve anything from a master server but generate the content themselves. That's the feature I've not seen publicly advertised on any CDN services, but that you could do with an anycast-enabled hosting provider (because they'd give you multiple accounts to run your website, that are linked by a common anycast IP)

Posted by CyberAlien, 05-04-2017, 05:03 PM
Update after few months. BunnyCDN staff found this interesting, but they had no solution. Other CDN services I've contacted didn't even bother to reply. But I've made it work anyway! So this is my solution: - Setup bunch of servers in different locations. I've used mix of cheap VPS solutions and AWS Beanstalk. - Use AWS Route53 to setup AnyCast DNS to point to all those locations. That's it. Response time varies between 50ms up to 150ms from anywhere in the world. Its not cheap, but at its the only viable solution. I'm expecting bill to be around $40/month. No other cloud hosting service offers AnyCast DNS. Amazon seems to be the only one in that market. Also AWS Lambda@Edge seems promising. Its a new thing Amazon are testing that allows to run code on edge servers. However it has limits: code with all dependencies and files should not exceed 1Mb, output should not exceed 40Kb, it works only with Node.js for now and its invite only. I didn't get my invite yet, so can't comment on performance. When researching Lambda@Edge I found lots of customers that want to get there as fast as possible because they have dynamic content that needs to be served with lowest possible latency. Could be good new market for CDN providers *hint*



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read


Language:

Client Login

Email

Password

Remember Me

Search