I went to the test site, and it works perfectly for me in Mozilla. It caches the pages unless I explicitly hit the reload button, and then they reload. I see your point about the refresh button in IE. Which is a shame, because otherwise it does exactly what we want it to. There has to be a setting somewhere in IE. Bother.
'The Girl in Question'
Buffistas Building a Better Board
Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.
that breaks the refresh key.
I can confirm that. Damn.
t edit I was testing with IE.
I see your point about the refresh button in IE.
And it's not just the refresh button.
There HAS to be (and I still can't find, despite having looked and asked for months) something that makes the PHP code behave normally. If I click on "Home", I want an updated page. If I hit "back", I want to see the exact same page I just left.
The change breaks re-clicking on home, and breaks refresh in IE.
That's a shitty user experience, and I know there's a way around it. Many PHP sites behave the way phoenix currently does, but not all. I haven't been able to work out what's being done in those.
I have a question -- are we trying to cut down on connections to the database, or queries?
[Because if I'm reading the SQL correctly, then, currently, each query is currently a separate connection, which means than every time someone posts, they're connecting to the database 5 times. I'm not sure if it would be more or less efficient to replace "connectAndQuery" with just "Query" and connect and disconnect only once. It would be a longer connection, but it would be only one.]
they're connecting to the database 5 times
Is there a disconnect before the next connect, or are there five simultaneous connections with each post?
Is there a disconnect before the next connect
Yes. They're not simultaneous.
There is a disconnect after each connect (see code quoted somewhere above -- except when a post is made). That is the change that was made in response to our exceeding concurrent connections.
The previous functionality was the default -- keep one connection per page (since the mysql_connect function only opens a connection if there isn't already one), closed implicitly when the page processing completed.
Now it's closed explicitly after each query, and Kristen reports this has made a difference, though not as much of one as I had hoped.
That is the change that was made in response to our exceeding concurrent connections.
That's what I suspected. Oh well.
The previous functionality was the default -- keep one connection per page (since the mysql_connect function only opens a connection if there isn't already one), closed implicitly when the page processing completed.
Would it improve performance at all to make the end-of-page close explicit, but not open more than one connection per page?
(It feels terribly inefficient to me, to use 5 connections where one would suffice, but, I'm not a server.)
Would it improve performance at all to make the end-of-page close explicit, but not open more than one connection per page?
It shouldn't make any difference. I hate to say "doesn't", but ... PHP doesn't maintain the connection once the page is loaded, so closing it at the end a) should be unneccessary, and b) would require testing for the presence of an open connection to know if one can close it, or to keep trapping and ignoring that "can't close! not open!" error message.
So, ita, what do you think about changing the mySQL variable "wait_timeout" to 30 seconds as an experiment? The default is eight hours, which means that if we are getting some connections left open due to bugs in PHP/mySQL/our code they could easily end up being 200 simultaneous idle connections at once.