'Set the caching duration which defines how long the
file will be cached.
@param duration: The cached file duration which defines how
long the file will be cached.  A duration=0 means forever.
The duration may be: (months|weeks|days|hours|minutes|seconds).
@type duration: {unit:value}'

def setduration(self, **duration):

    if (len(duration) == 1):
        arg = duration.items()[0]
        if (not (arg[0] in self.units)):
            raise Exception(('must    be:    %s' % str(self.units)))
        self.duration = arg
    return self
