Jiveabillion
-
7/5/2012 3:05:16 PM
RE:Issue with Prev/Next blog post buttons on single blog post page
I actually did this last week on one of my high traffic websites. I was using database functions that return the next and previous document ID for blog posts so that I could then put links to the next and previous blog posts using a custom macro method for K# in a Text/xml transformation. This caused my SQL server to use a whole processor core when I had 200 users on the site.
What I did to solve this problem was create a handler that I pass 2 query string parameters to, Forward or backwards, and the current documentID. I made the next and previous buttons point to this handler with those query string parameters so that the server didn't have to process those expensive queries on every page load, only when someone actually clicks on the link.
It works great and my SQL server CPU usage stays nice and low now.
|