NYCPHP Meetup

NYPHP.org

[nycphp-talk] securing a file w/ htaccess?

Mikko Rantalainen mikko.rantalainen at peda.net
Fri Nov 18 03:06:49 EST 2005


billy reisinger wrote:
>>If you are concerned about someone reading the source code, using it for
>>their own purposes or finding out some super secret proprietary business
>>info then it shouldn't be done client side.  Do it server side.
> 
> That's a very good point.  I've been asked to implement a  "suggest"
> feature (ala Google) while avoiding increased client/server traffic. 

There's no way that you or anybody else can implement the "google 
suggest" feature without increasing the server traffic. It's plain 
impossible - think about it! The "suggest" feature provides the user 
more data while he's using the application and transferring more 
data *will* increase the server traffic.

> I could use XMLHttpRequest to fetch only that data that I need from
> the server.  The problem with that, again, is the added server load it
> would cause.  But you're right, in this case it's probably best to do
> the searching on the server side, and that's what I'll have to
> "suggest" to the boss.

I hope your previous plan (doing it in the client end) wasn't too 
close to "the Javascript Search Engine" featured in The Daily WTF a 
few days ago: http://thedailywtf.com/forums/50523/ShowPost.aspx

If you cannot deal with the increased server load caused by 
"suggest" feature implemented with XMLHttpRequest, then you probably 
shouldn't implement the "suggest" feature at all. If you're trying 
to implement this with JavaScript, the JavaScript file will end up 
being quite a huge file and that will cause increased server load, too.

-- 
Mikko



More information about the talk mailing list