Forum Moderators: coopster

Message Too Old, No Replies

Determine if database stored page requested should HTTP 200 or 304?

How do I determine based on client headers?

         

JAB Creations

10:26 am on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am storing site content in a database, have the last date modified set, and am correctly sending the last-modified date header however I'm not sure how to program my site to send HTTP 304 if the page has not been modified...mainly since I don't know if this is based off of a header sent by the client or something else?

So how do I determine if the client has requested the page? I can't blindly serve HTTP 304 codes right? Some direction would be greatly appreciated! :)

- John

JAB Creations

11:03 am on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think what I'm looking for is an etag...though it seems the string to compare to at a later date can be anything so long as you're comparing the etag for the same page...if all of that is true then I could simply store the edited number (create = 1, edit first time = 2, second edit = 3, third edit = 4, etc) as the etag number to compare against?

- John