         }
     }
 
-    func writeData(data: NSData) {
+    func etagFileNameFromDataFile(dataFileName: String) -> String {
+        return dataFileName + ".etag"
+    }
+
+    func readDataEtag() -> String? {
+        let (dir, _) = dataDir()
+        let path = etagFileNameFromDataFile(dir + "/" + dataFile)
+        if !NSFileManager.defaultManager().fileExistsAtPath(path) {
+            return nil
+        }
+        guard let data = NSFileManager.defaultManager().contentsAtPath(path) else { return nil }
+        return NSString(data: data, encoding: NSUTF8StringEncoding) as? String
+    }
+
+    func writeData(data: NSData, etag: String?) {
         let (dir, wasCreated) = dataDir()
         // If dir existed already, clear out the old one
         if !wasCreated {

        if !data.writeToFile(path, atomically: true) {
            showError("Failed to write data to \(path)")
        }
    }

    func readData() -> NSData? {

import Foundation
import Shared
import Alamofire

private let _singleton = AdBlocker()

class AdBlocker {
    static let prefKeyAdBlockOn = "braveBlockAds"
    static let prefKeyAdBlockOnDefaultValue = true
    static let dataVersion = "1"
    let dataUrl = NSURL(string: "https://s3.amazonaws.com/adblock-data/\(dataVersion)/ABPFilterParserData.dat")!
    let dataFile = "abp-data-\(dataVersion).dat"

    // Store the last 500 URLs checked
