use of com.att.aro.core.packetanalysis.pojo.CacheEntry in project VideoOptimzer by attdevsupport.
the class CacheAnalysisImpl method handleCacheExpiredWithByteInCache.
CacheEntry handleCacheExpiredWithByteInCache(Session session, HttpRequestResponseInfo response, HttpRequestResponseInfo request, PacketInfo firstPacket, CacheEntry cacheEntry, long bytesInCache) {
CacheEntry newCacheEntry = handleCacheExpiredCommon(session, response, request, firstPacket, cacheEntry);
if (newCacheEntry == null) {
if (request.isIfModifiedSince() || request.isIfNoneMatch()) {
newCacheEntry = new CacheEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_PARTIALHIT_SERVER, bytesInCache, firstPacket);
duplicateEntries.add(new DuplicateEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_PARTIALHIT_SERVER, firstPacket, session, getContent(response, session)));
} else {
newCacheEntry = new CacheEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_PARTIALHIT_CLIENT, bytesInCache, firstPacket);
duplicateEntries.add(new DuplicateEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_PARTIALHIT_CLIENT, firstPacket, session, getContent(response, session)));
}
}
return newCacheEntry;
}
use of com.att.aro.core.packetanalysis.pojo.CacheEntry in project VideoOptimzer by attdevsupport.
the class CacheAnalysisImpl method handleCacheExpiredCommon.
CacheEntry handleCacheExpiredCommon(Session session, HttpRequestResponseInfo response, HttpRequestResponseInfo request, PacketInfo firstPacket, CacheEntry cacheEntry) {
// Check to see if object changed
HttpRequestResponseInfo cachedResponse = cacheEntry.getResponse();
boolean isTheSame = rrhelper.isSameContent(response, cachedResponse, session, cacheEntry.getSession());
CacheEntry newCacheEntry;
if ((response.getLastModified() != null && cachedResponse.getLastModified() != null && !response.getLastModified().equals(cachedResponse.getLastModified())) || !isTheSame) {
newCacheEntry = new CacheEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_CHANGED, firstPacket);
} else if (response.getStatusCode() == 304) {
newCacheEntry = new CacheEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_304, firstPacket);
} else {
newCacheEntry = null;
}
return newCacheEntry;
}
use of com.att.aro.core.packetanalysis.pojo.CacheEntry in project VideoOptimzer by attdevsupport.
the class CacheAnalysisImpl method handleCacheExpired.
CacheEntry handleCacheExpired(Session session, HttpRequestResponseInfo response, HttpRequestResponseInfo request, PacketInfo firstPacket, CacheEntry cacheEntry) {
CacheEntry newCacheEntry = handleCacheExpiredCommon(session, response, request, firstPacket, cacheEntry);
if (newCacheEntry == null) {
if (request.isIfModifiedSince() || request.isIfNoneMatch()) {
newCacheEntry = new CacheEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_SERVER, firstPacket);
duplicateEntries.add(new DuplicateEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_SERVER, firstPacket, session, getContent(response, session)));
} else {
newCacheEntry = new CacheEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_CLIENT, firstPacket);
duplicateEntries.add(new DuplicateEntry(request, response, Diagnosis.CACHING_DIAG_OBJ_NOT_CHANGED_DUP_CLIENT, firstPacket, session, getContent(response, session)));
}
}
return newCacheEntry;
}
Aggregations