Welcome Guest, Not a member yet? Register   Sign In
Making a search page. POST, GET, TOKEN?
#1

[eluser]RS71[/eluser]
Hello,

I'm trying to make a search page and I was wondering what would be the best approach for this. At the moment, I save search filters to a session and use them when doing queries. The thing is, although I haven't given it much thought, I'd probably like for users to be able to send and bookmark links. What do you guys think I do? GET would probably work but I might end up with a very long url like:

Quote:http://localhost/search/gallery/1/?price...5-84-87-23

and so forth..

I came across this page,

http://stackoverflow.com/questions/29747...089#298089

which talks about using Tokens. A system similar to TinyURL's where fields/parameters are saved and retrieved from the DB using a token before making the actual 'search' query.

What do you guys think? Would it slow down my search pages too much, having to

- SELECT fields using token
- SELECT results
- SELECT count for pagination

if changing filters:

- INSERT fields using token
- SELECT results
- SELECT count for pagination

Please let me know what you think.
Thanks in advance,
RS71
#2

[eluser]Damien K.[/eluser]
Myself, being the so non-performance concerned guy, don't see how this can slow your site to a crawl (i.e., affect performance). I see why TinyURL would do that because it is their service model to provide, err, tiny urls. But for search parameters, I see that as an unnecessary overhead unless you have a similar service model. One question to ask yourself is whether you plan to persist the seach parameters indefinitely. If yes, then the approach is rather obvious. If not, I would stick with some sort of GET method. Another question is how necessary is to have "pretty" urls?




Theme © iAndrew 2016 - Forum software by © MyBB