 	
 	let chunkedBufferSize = 1024*200
 	let documentRoot: String
+	let allowResponseFilters: Bool
 	
 	/// Public initializer given a document root.
-	public init(documentRoot: String) {
+	/// If allowResponseFilters is false (which is the default) then the file will be sent in 
+	/// the most effecient way possible and output filters will be bypassed.
+	public init(documentRoot: String, allowResponseFilters: Bool = false) {
 		self.documentRoot = documentRoot
+		self.allowResponseFilters = allowResponseFilters
 	}
 	
     /// Main entry point. A registered URL handler should call this and pass the request and response objects.
     /// After calling this, the StaticFileHandler owns the request and will handle it until completion.
-	public func handleRequest(request req: HTTPRequest, response: HTTPResponse) {
-        var path = req.path
+	public func handleRequest(request: HTTPRequest, response: HTTPResponse) {
+        var path = request.path
 		if path[path.index(before: path.endIndex)] == "/" {
 			path.append("index.html") // !FIX! needs to be configurable
 		}

		}
        do {
            try file.open(.read)
            self.sendFile(request: req, response: response, file: file)
        } catch {
            return fnf(msg: "The file \(path) could not be opened \(error).")
        }
	}
	
	func sendFile(request req: HTTPRequest, response resp: HTTPResponse, file: File) {
		
		resp.addHeader(.acceptRanges, value: "bytes")

		if let rangeRequest = req.header(.range) {
            return self.performRangeRequest(rangeRequest: rangeRequest, request: req, response: resp, file: file)
        } else if let ifNoneMatch = req.header(.ifNoneMatch) {
            let eTag = self.getETag(file: file)
            if ifNoneMatch == eTag {
                resp.status = .notModified
                return resp.completed()
            }
        }
        
        let size = file.size
        let contentType = MimeType.forExtension(file.path.pathExtension)
        
		resp.status = .ok
		resp.addHeader(.contentType, value: contentType)
		resp.addHeader(.contentLength, value: "\(size)")
        
        self.addETag(response: resp, file: file)
        
		if case .head = req.method {
			return resp.completed()
		}
		
		self.sendFile(remainingBytes: size, response: resp, file: file) {
			ok in
			file.close()
			resp.completed()
		}
	}
	

            }
            
            file.marker = range.lowerBound
			// send out headers
			response.push { ok in
				guard ok else {
					file.close()
					return response.completed()
				}
				return self.sendFile(remainingBytes: rangeCount, response: response, file: file) {
					ok in
					
					file.close()
					response.completed()
				}
			}
        } else if ranges.count > 0 {
            // !FIX! support multiple ranges
            response.status = .internalServerError
