Skip to content

Commit

Permalink
Revert "Saving the cached file with extension"
Browse files Browse the repository at this point in the history
This reverts commit 29c07df.
  • Loading branch information
raulriera committed Feb 14, 2013
1 parent d22036d commit bcfba89
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ XHR.prototype.destroy = function(url, onSuccess, onError, extraParams) {

readCache = function(url) {
// Hash the URL
var ext =/(?:\.([^.]+))?$/.exec(url)[1];
var hashedURL = Titanium.Utils.md5HexDigest(url) + (ext ? '.'+ext : '');
var hashedURL = Titanium.Utils.md5HexDigest(url);

// Check if the file exists in the manager (append the .dat extension?)
var cache = cacheManager( { "file": hashedURL } ).first();
Expand Down Expand Up @@ -304,8 +303,7 @@ writeCache = function(data, url, ttl) {
// Titanium.API.info("WRITING CACHE");

// hash the url
var ext =/(?:\.([^.]+))?$/.exec(url)[1];
var hashedURL = Titanium.Utils.md5HexDigest(url) + (ext ? '.'+ext : '');
var hashedURL = Titanium.Utils.md5HexDigest(url);

// Write the file to the disk
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, hashedURL);
Expand Down

0 comments on commit bcfba89

Please sign in to comment.