Permalink
Browse files

killer user cache

  • Loading branch information...
1 parent 9954277 commit 58429877e35392fa725b4e79673be5f924b6beb8 @jaseemabid jaseemabid committed Oct 11, 2011
Showing with 11 additions and 14 deletions.
  1. +11 −14 js/xkcd_cli.js
View
@@ -42,20 +42,17 @@ var xkcd = {
error(false);
return false;
}
-
- if (num in this.cache) {
- this.last = this.cache[num];
- success(this.cache[num]);
- } else {
- return $.ajax({
- url: this.baseQ+path,
- dataType: 'json',
- success: $.proxy(function(data) {
- this.last = this.cache[num] = data;
- success(data);
- }, this),
- error: error});
- }
+
+ return $.ajax({
+ url: this.baseQ+path,
+ dataType: 'json',
+ success: $.proxy(function(data) {
+ this.last = data;
+ success(data);
+ }, this),
+ error: error
+ });
+
}
};

0 comments on commit 5842987

Please sign in to comment.