Skip to content

Commit

Permalink
test optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
wuchangming committed Feb 2, 2016
1 parent 582f0fb commit 7bccbb3
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 31 deletions.
10 changes: 5 additions & 5 deletions dist/jquery-ajax-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ return /******/ (function(modules) { // webpackBootstrap

_createClass(CacheProxy, [{
key: 'genCacheKey',
value: function genCacheKey(AjaxOptions, originalOptions) {
var dataString = AjaxOptions.data;
var key;
value: function genCacheKey(options, originalOptions) {
var dataOrigin = originalOptions.data || {};
var key, dataString;
try {
if (typeof dataString !== 'string') {
dataString = JSON.stringify(AjaxOptions.data);
dataString = JSON.stringify(dataOrigin);
}
key = AjaxOptions.ajaxCache.cacheKey || AjaxOptions.url.replace(/jQuery.*/, '') + AjaxOptions.type.toUpperCase() + (dataString || '') + (AjaxOptions.ajaxCache.version || _config.defaultDataVersion);
key = originalOptions.ajaxCache.cacheKey || originalOptions.url.replace(/jQuery.*/, '') + options.type.toUpperCase() + (dataString || '') + (originalOptions.ajaxCache.version || _config.defaultDataVersion);
console.log(key);
key = md5(key);
} catch (e) {
Expand Down
Loading

0 comments on commit 7bccbb3

Please sign in to comment.