'Set the C{Last-Modified} time for the response to this request.
If I am called more than once, I ignore attempts to set
Last-Modified earlier, only replacing the Last-Modified time
if it is to a later value.
If I am a conditional request, I may modify my response code
to L{NOT_MODIFIED} if appropriate for the time given.
@param when: The last time the resource being returned was
modified, in seconds since the epoch.
@type when: number
@return: If I am a C{If-Modified-Since} conditional request and
the time given is not newer than the condition, I return
L{http.CACHED<CACHED>} to indicate that you should write no
body.  Otherwise, I return a false value.'

def setLastModified(self, when):

    when = int(math.ceil(when))
    if ((not self.lastModified) or (self.lastModified < when)):
        self.lastModified = when
    modifiedSince = self.getHeader('if-modified-since')
    if modifiedSince:
        firstPart = modifiedSince.split(';', 1)[0]
        try:
            modifiedSince = stringToDatetime(firstPart)
        except ValueError:
            return None
        if (modifiedSince >= self.lastModified):
            self.setResponseCode(NOT_MODIFIED)
            return CACHED
    return None
