Wednesday, March 13, 2019

SheppyBrew.com Update

So ... Remember in SheppyBrew 2018 Year-End Brewing Stats, I mentioned:

"www.sheppybrew.com has been having issues. I hope to work on the website this year to correct those problems. I'm not sure what exactly is going on, but the website isn't always rendering the correct page."


The issue that I was referring to was that the server was caching my pages. This would have been fine, but the web server was not treating query strings as different content.


For example ... on my site, the "5th Season Blood Orange Saison" recipe page is:

http://www.sheppybrew.com/recipes/recipe.aspx?id=154

?id=154 is the query string.

"Mardi Bock" is:

http://www.sheppybrew.com/recipes/recipe.aspx?id=153

?id=153 is the query string

Those 2 urls are the same except for the query string. However, the content is much much different. One is a Saison and one is a Bock for God's sake.

My website is a simple content management tool that I developed back when I used to be a computer geek. The content of the pages are stored in a database and the site knows what to render based on what query string id is presented to it.

However, the "Output Caching" settings on the server, assumed that id=153 and id=154 were the same, so after it cached /recipes/recipe.aspx?id=154, all that the server would be presenting to web browsers was "5th Season Blood Orange Saison".

Luckily, the cache expired fairly quickly, but still, it was a pain to look at more than one page in a shortish amount of time.

My webhosting company abstracts the IIS settings, and this setting is not one they present in the configuration tool they let me use. They didn't warn me that this setting was changing. I'm not an IIS expert, so I didn't really know this setting existed.




But, yesterday, I finally took the time to google and experiment on IIS servers I have at work (I am a Software Development Manager by profession).

It took me awhile to figure this out. I'm ashamed of myself.
As it turned out, it was a simple fix. I was able to overwrite this setting by modifying my web.config

<system.webServer>
    <caching enabled="false"/>
</system.webServer>
<system.web>
    <caching>
         <outputCache enableOutputCache="false"/>     
    </caching>
</system.web>
So, my issue is now fixed

Hurray for me!

I should brew this weekend!

No comments:

Post a Comment