Go Back   HostGator Peer Support Forums > Public Forums > Suggestions

Notices

Reply
 
Thread Tools
  #1  
Old 11-25-2008, 08:11 PM
psychevinyl psychevinyl is offline
Hatchling Croc
 
Join Date: Nov 2008
Posts: 17
Default mod_proxy & magic buttons

apache's mod_proxy is a small apache plug-in that allows url changes,redirects with someways. what makes this small plug-in special at these days is;

when you want your Ajax application to make a XMLHTTPRequest, you will hit the crossdomain restriction. Basically you cant make a XMLHTTPRequest other domains, this is infact a good security rule, but there is a conflict; if you want to use a webservice of a server with ajax (or flash/flex) you need to connect and grab the data you want.

mod_proxy simply makes a trick;
assume that you need to grab similar artist data from last.fm;
http://ws.audioscrobbler.com/1.0/art...ca/similar.xml

if you make an ajax request to that adress, you will get permission denied becouse of cross domain restriction, so you need to pass it to a different way on your server;

a cheap .htaccess trick makes this possible;
put this .htaccess in a folder, lets say abcde folder,

RewriteRule ^(.*)$ http://ws.audioscrobbler.com/$1 [P]

when you make your new ajax request to; http://www.yoursite.com/abcde/1.0/ar...ca/similar.xml
apache will automatically change it to http://ws.audioscrobbler.com/1.0/art...ca/similar.xml

so everything will be tutti-frutti!


think of my site bringing artist information from wikipedia (which will cost me 100k to fetch, 100k to show) + last.fm similar artist data ( will cost 50k to fetch 50k to show.......) if i use php's simplexml to fetch, this brings a high amount of ram (and relatively cpu) usage to my program
and such kind of a program is bringing more load to server, instead with a simple .htaccess all can be done, and i can send it to users computer and i can shape this xml in users computer, and show it to user again.

by the way this is not a hack, it is the usual way (yahoo tells this from their front page from their ajax pages)

another of my wish is, i saw a site (i really couldnt remember at the moment), there was a magic button, that shows how many months left for your hosting, and it tells nicely to its users:
let this site go!!! add 1 month more!! and when a user click it, they can add one more month with paying...a kind of donation method..
well i hate of periodical payments in my life, one thing more i hate is site ads..
my site is a kind of community site, and my faithful users wont hesistate to add one more month to make that site go on..so such kind of a button may make things a lot easy for me, and it would also be great for hostgator too..
think of a month cost is 8 dolar, then you may make this button for 10 dolar to add a month donation..
most of the time, the site (faithful) users of a site wont aware how the things are going (economically), i believe such kind of a button may give hints to them, and if oneday i needed to upgrade a dedicated hosting, i could (-economically-) check my user base if things are ready

well sorry for my english, but i think i succeeded to express myself

thanks a lot
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gator Buttons! REVOLUTIONS inc. Off-Topic 14 10-01-2008 07:29 PM
mod_proxy ram0135 Shared Hosting Support 0 01-19-2008 01:09 AM

All times are GMT -5. The time now is 03:29 PM.