This past weekend, I made my website so that it would respond correctly to at least two conditional types of conditional requests. The first was the "If-None-Match" header request. This was the easiest because all I had to do was compare the provided ETag with the current ETag. If they match, the server now responds with a 304 Not Modified response, and saves me some bandwidth, and speeds up the page. (Not that I need to save bandwidth. I paid for 15 GB of bandwith, but last month, I used less than 50MB. Google is only indexing the main page of my site for some odd reason.) Anyway, the second request type that I put into my site was the "If-Modified-Since" request. At first, I tried to write a regex that would extract the desired time info from the request header, but was unsuccessful in doing so. I resorted to comparing the received string with the string that would be sent normally. I just found the php function strtodate(), and think I will use that instead of comparing strings.


0 Comments:
Post a Comment
<< Home