
com.hannesdorfmann.httpkit.cache.DefaultCacheEntryExpirator Maven / Gradle / Ivy
package com.hannesdorfmann.httpkit.cache;
/**
* This {@link CacheEntryExpirator} uses unix timestamps (in miliseconds) in UTC
* timezone to determine if a {@link CacheEntry} is expired or not.
*
* This one should be used for the http header field "Expires". Example:
* Expires: Tue, 20 Mar 2007 04:00:25 GMT
*
* @author Hannes Dorfmann
*
*/
public class DefaultCacheEntryExpirator implements CacheEntryExpirator {
public static DefaultCacheEntryExpirator INSTANCE = new DefaultCacheEntryExpirator();
@Override
public boolean isExpired(long entryTimestamp) {
return System.currentTimeMillis() > entryTimestamp;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy