we were making an extra apache request for _every_ page. even if it returns
304, we still made the hit. when we push 100-250 reqs per second, like we do
when we're real busy, then an extra request for each 'real' apache request
is just insane.
Well, with the changes made by Sascha (1.3->1.4) there would be no duplicate requests if the software involved supports "Cache-control". I thought this would solve the problem.
The code still works, it only includes the css style if the ip2country stuff
works out. we eat a bit on it being cached... but then again, it's in every
header, so it'll work as the user browses around...
if we get reports, investigate another method or ditch it, but i'm quite
confident that this works well enough now.
OK, what do you think about some JS stuff? :) We have the cookie on the client side accessible for JS, so we can style the page accordingly without any explicit spec in the ouptout. I am planning to implement "search keyword" and "search option selection" remembering code the same way.
1. Set a cookie on client
2. Add static JS code to pages working with cookies and modifying the
page on the client side
Remember keywords or autoselect an option from a dropdown is fairly simple to do in crossbrowser JS, and not really a magic. And is perfectly cache friendly (in case no weird cache returns set-cookie headers for clients).
Goba