BLACKISH DEV BLOG Support
 

 

Using PHP to forward/fork to unity webplayers

All in all I think using AWS is a pretty decent solution that should keep me from getting kicked from my normal shared webserver for generating huge amounts of traffic (“unlimited” can be pretty limited if there’s a “fair use” clause attached).

Since I’m already paying for it though, I’d like to use the shared server as much as possible before generating any additional costs through AWS.

So… Instead of linking to the webplayer.unity file directly (on the local server or on AWS), I set the link to webplayer.php (a super-basic PHP page, that does nothing but forward to the real unity-file)


<?php
header("Location: http://d2s94hjscj93hx.cloudfront.net/webplayer.unity3d");
?>

The next step would now be to make the webserver aware of its state and make it switch to AWS automatically as soon as certain criteria are fullfilled… Several ideas are:

  • If you have a traffic-limit it could count the number of downloads this month and switch as soon as it gets close to the limit
  • It could switch to AWS if traffic goes beyond a certain amount of downloads per hour
  • switch to normal service during the lower-traffic times of the day
Bookmark the permalink. Follow any comments here with the RSS feed for this post. Trackbacks are closed, but you can post a comment.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>