Here’s the deal: I don’t like using GET parameters if I don’t have to. ReadBurner uses them all over the place; the problem is that it starts getting very tricky to maintain state with GET parameters because you have to continue to pass the same parameters to every link. So if you use a GET parameter to set the preview type; then every link has to have that GET parameter in it or the preview type will be forgotten the next time you click.
GET parameters were not meant for that type of use; cookies are. Using a cookie is very nice for settings like this. Not only do you gain complete state (close your browser and open up the site again and it’ll remember your settings) but you also lose those nasty parameters at the end of the url; I’m all about clean urls.
But cookies don’t work well with caching; neither do GET parameters but they get along nicer. I got hit hard and couldn’t keep up with the small amount of caching that I was doing; so I disabled the sessions and cached everything. Now I can handle the traffic but Louis Gray mentioned I didn’t support preview settings; and I wanted to right that wrong.
So now I do some fancy caching that using the Vary header. Basically; if you have a cookie set; you are getting fresh data. If you don’t have a cookie set then you get the cached page. This will do for now. If I find that most of my users are picking a setting (and thus setting a cookie) then I’ll have to change things. But I hope that most visitors don’t click on that setting; most visitors come, see the main page, and leave.

Add New Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks