Handles setting pages that are always to be revalidated for freshness by any cache.

@param int $last_modified Timestamp in seconds
12735
public static function exitIfNotModifiedSince($last_modified)
    {
        if (self::isModified($last_modified)) {
            self::sendNotModified();
            exit(0);
        }

        $last_modified = gmdate('D, d M Y H:i:s', $last_modified) . ' GMT';
        header("Cache-Control: must-revalidate");
        header("Last Modified: $last_modified");
    }
1374400
protected function setCacheHeaders($lastModified, $file, $hit)
    {
        //  Set some flags
        $this->cacheHeadersSet          = true;
        $this->cacheHeadersMaxAge       = 31536000; // 1 year
        $this->cacheHeadersLastModified = $lastModified;
        $this->cacheHeadersExpires      = time() + $this->cacheHeadersMaxAge;
        $this->cacheHeadersFile         = $file;
        $this->cacheHeadersHit          = $hit ? 'HIT' : 'MISS';

        // --------------------------------------------------------------------------

        header('Cache-Control: max-age=' . $this->cacheHeadersMaxAge . ', must-revalidate', true);
        header('Last-Modified: ' . date('r', $this->cacheHeadersLastModified), true);
        header('Expires: ' . date('r', $this->cacheHeadersExpires), true);
        header('ETag: "' . md5($this->cacheHeadersFile) . '"', true);
        header('X-CDN-CACHE: ' . $this->cacheHeadersHit, true);
    }
135858
protected function flushOldCache()
    {
        do_action("before_theme_flush_old_cache");

        $files = glob($this->cachePath . "*");
        $files = (is_array($files) && $files ? $files : array());

        $cache_config = $this->getConfig("cache");

        foreach ($files as $file):
            if (file_exists($file) && (time() - filemtime($file) > $cache_config["lifetime"])):
                unlink($file);
            endif;
        endforeach;

        do_action("after_ntl_flush_old_cache");
    }
555476
public function refreshLastUsed($sessionId, $lastUsed = null)
    {
        if ($sessionInformation = $this->getSessionInformation($sessionId)) {
            if ($sessionInformation->getLastUsed() !== $lastUsed) {
                $sessionInformation->refreshLastUsed($lastUsed);
                $this->saveSessionInformation($sessionInformation);
            }
        }
    }
146665
public function touchLastSeen()
    {
        if ($this->isOnline()) {
            return;
        }

        $oldTimestamps = $this->timestamps;
        $this->timestamps = false;

        $this
            ->newQuery()
            ->where('id', $this->id)
            ->update(['last_seen' => $this->freshTimestamp()])
        ;

        $this->last_seen = $this->freshTimestamp();
        $this->timestamps = $oldTimestamps;
    }
345854
def _get_last_cachefile_modification(self):
        

        try:
            mtime = os.path.getmtime(self._tld_list_path)
        except OSError:
            return None

        return datetime.fromtimestamp(mtime)
156486
def set_last_access(self, tag):
        """"""
        import time
        # time defeats check that value didn't change

        self.buildstate.access.last = '{}-{}'.format(tag, time.time())
        self.buildstate.commit()
1055914
static protected function applyDefaultHeaders( $size = NULL, $timestamp = NULL )
	{
		header( "Pragma: public" );
		header( "Expires: -1" );
		header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
		if( (int) $size > 0 )
			header( "Content-Length: ".( (int) $size ) );
		$timestamp	= ( (float) $timestamp ) > 1 ? $timestamp : time();
		header( "Last-Modified: ".date( 'r', (float) $timestamp ) );

	}
1010912
public static void addLastModified(Result result, long lastModified) {
        result.with(HeaderNames.LAST_MODIFIED, DateUtil.formatForHttpHeader(lastModified));
    }
282096
public function setNameLast($name_last){
        if(!$this->setModified('name_last', $name_last)->isModified()) {
            return $this;
        }
        $this->name_last = $name_last;

        return $this;
    }
1292060
public static function cache($expire = 3600, $last_modify = null) {
        $time    = time();
        $date    = gmdate('D, d M Y H:i:s', $time) . ' GMT';
        $headers = [
            'Age'           => $expire,
            'Date'          => $date,
            'Expires'       => gmdate('D, d M Y H:i:s', $time + $expire) . ' GMT',
            'Cache-Control' => 'public, must-revalidate, max-age=' . $expire,
            'Pragma'        => 'cache'
        ];
        if ($last_modify) {
            $ldate                    = @gmdate('D, d M Y H:i:s', $last_modify) . ' GMT';
            $headers['Last-Modified'] = $ldate;
        }
        foreach ($headers as $header => $val) {
            @header($header . ': ' . $val);
        }
    }
404187
public function refreshCache()
    {
        $app = Facade::getFacadeApplication();
        $cache = $app->make('cache/request');
        if ($cache->isEnabled()) {
            $cache->delete('page/'.$this->getCollectionID());
        }
    }
227556
function MustUseCache()
    {
        if ($this->cacheLifetime == 0)
        {
            return false;
        }
        if (!File::Exists($this->file))
        {
            return false;
        }
        $now = Date::Now();
        $lastMod = File::GetLastModified($this->file);
        if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)
        {
            return true;
        }
        return false;
    }
188086
public JobScheduleAddHeaders withLastModified(DateTime lastModified) {
        if (lastModified == null) {
            this.lastModified = null;
        } else {
            this.lastModified = new DateTimeRfc1123(lastModified);
        }
        return this;
    }
464713
public function lastModified($modified = null)
    {
        if ($modified && $modified > $this->last_modified) {
            $this->last_modified = $modified;
        }

        return $this->last_modified;
    }
150711
public function updateLastAction ()
	{
		
		$arr	= $this->getSessionData ();
		
		$this->lastAction		= time ();
		$arr['last_action']		= $this->lastAction;
		
		$this->session ()->set (get_called_class (), serialize ($arr));
		
	}
1334587
public function setLastModification($lastModification)
    {
        if ($lastModification instanceof \DateTime) {
            $lastModification = new LastModification($lastModification);
        }
        $this->elements[self::ELEMENT_LASTMOD] = $lastModification;

        return $this;
    }