Changeset 2402 for trunk/phpgwapi


Ignore:
Timestamp:
04/01/10 14:57:26 (14 years ago)
Author:
amuller
Message:

Ticket #1022 - Mudando critérios de req. ao entrar na cache/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/js/expressoAjax/expressoAjax.js

    r2328 r2402  
    4242                this.oldY = 0; 
    4343                this.updateVersion = ""; 
     44                this.cacheRequest = null; 
    4445                this.connectorCache = { 
    4546                                'valid' : [], 
     
    516517                } 
    517518        } 
     519        cConnector.prototype.cacheNextRequest = function(expiration){ 
     520                if (typeof(expiration) == 'undefined') 
     521                        expiration=0; 
     522                this.cacheRequest=expiration; 
     523        } 
     524 
    518525        cConnector.prototype.addToCache = function(id,data){ 
    519526                if (typeof(preferences) == "undefined" || preferences.use_cache != 'True') 
     
    522529                if (func.indexOf('&') > 0) 
    523530                        func = func.substr(0,func.indexOf('&')); 
    524                 switch (func){ 
    525                         // functions that enters in cache 
    526                         case 'get_info_msg': 
     531                switch (this.cacheRequest){ 
     532                        // functions that enters in cache and never expires 
     533                        case 0: 
    527534                                data.cacheHit = true; 
    528                         case 'get_preferences': 
    529                         case 'getSharedUsersFrom': 
    530                         case 'get_organizations': 
    531                         case 'get_catalogs': 
    532                         case 'get_dropdown_contacts': 
    533                         case 'get_cc_contacts': 
    534                         case 'get_cc_groups': 
    535                         case 'getUsersByEmail': 
    536535                                this.connectorCache.valid[id] = true; 
    537536                                this.connectorCache.result[id] = data; 
    538537                                break; 
     538                        case 1: 
    539539                        // function that needs expire 
    540                         case 'get_range_msgs2': 
    541                         case 'quicksearch': 
    542                         case 'get_folders_list': 
    543                         case 'search_msg': 
    544                         case 'search_for': 
    545540                                this.connectorCache.valid[id] = true; 
    546                                 this.connectorCache.result[id] = data; 
     541                                this.connectorCache.result[id] = data; 
    547542                                var i = this.expurgatedCache.length; 
    548543                                this.expurgatedCache[i+1] = id; 
    549544                                break; 
     545                        case 2: 
    550546                        //functions that expires the cache 
    551                         case 'move_messages': 
    552                         case 'delete_msgs': 
    553                         case 'getReturnExecuteForm': 
    554                         case 'set_messages_flag': 
    555                         case 'empty_trash': 
    556547                                this.purgeCache(); 
    557                         default: // no cache 
     548                        default: 
     549                        // no cache 
    558550                                break; 
    559551                } 
Note: See TracChangeset for help on using the changeset viewer.