views:

22

answers:

1

I have an index of titles that I am currently filtering by user entered keywords on the server before sending to HTML. I am wondering if it would be better to send the entire index to the page and have javascript show or hide the items in the list based on the user input.

I am concerned that the server side is going to get too many requests as users use different keyword combinations. Even if I cache the index on the server, wont the javascript solution be a better one?

EDIT: assuming a list of thousand titles or more.

+1  A: 

You have to take into account two facts:

(a) not all users have Javascript or Javascript on

This means that it is possible that client-side filtering may not be working.

(b) some visitors could be limited in resources (slow CPU, older [slower] Javascript implementation)

By sending the entire set for processing on the client (especially if your data set is large enough) my guess is that your visitors will start complaining.

Finally, what you gain in server processing time you will be losing in bandwidth.

Anax