Search in sources :

Example 21 with CacheEntry

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;
}
Also used : DuplicateEntry(com.att.aro.core.packetanalysis.pojo.DuplicateEntry) CacheEntry(com.att.aro.core.packetanalysis.pojo.CacheEntry)

Example 22 with CacheEntry

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;
}
Also used : HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) CacheEntry(com.att.aro.core.packetanalysis.pojo.CacheEntry)

Example 23 with CacheEntry

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;
}
Also used : DuplicateEntry(com.att.aro.core.packetanalysis.pojo.DuplicateEntry) CacheEntry(com.att.aro.core.packetanalysis.pojo.CacheEntry)

Aggregations

CacheEntry (com.att.aro.core.packetanalysis.pojo.CacheEntry)23 ArrayList (java.util.ArrayList)7 BaseTest (com.att.aro.core.BaseTest)6 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)6 Test (org.junit.Test)6 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)4 DuplicateEntry (com.att.aro.core.packetanalysis.pojo.DuplicateEntry)3 Session (com.att.aro.core.packetanalysis.pojo.Session)3 CacheAnalysis (com.att.aro.core.packetanalysis.pojo.CacheAnalysis)2 Diagnosis (com.att.aro.core.packetanalysis.pojo.Diagnosis)2 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)2 DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 JButton (javax.swing.JButton)2 CacheControlResult (com.att.aro.core.bestpractice.pojo.CacheControlResult)1 DisplayNoneInCSSEntry (com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry)1 DuplicateContentResult (com.att.aro.core.bestpractice.pojo.DuplicateContentResult)1