diff --git a/app.py b/app.py index 55d79e1..ffb9bd3 100755 --- a/app.py +++ b/app.py @@ -272,8 +272,10 @@ def serve_file(filename): if not os.path.isfile(full_path): app.logger.error(f"File not found: {full_path}") return "File not found", 404 - - log_file_access(full_path) + + # Exclude HEAD requests from logging + if request.method != 'HEAD': + log_file_access(full_path) mime, _ = mimetypes.guess_type(full_path) mime = mime or 'application/octet-stream' @@ -283,12 +285,10 @@ def serve_file(filename): # Check cache first (using diskcache) cached = cache.get(filename) if cached: - app.logger.info(f"Cache hit for {filename}") cached_file_bytes, mime = cached cached_file = io.BytesIO(cached_file_bytes) response = send_file(cached_file, mimetype=mime) else: - app.logger.info(f"Cache miss for {filename}") if mime and mime.startswith('image/'): # Image processing branch (with caching) try: diff --git a/templates/browse.html b/templates/browse.html index bbf368d..ec6ef64 100644 --- a/templates/browse.html +++ b/templates/browse.html @@ -2,7 +2,6 @@
- @@ -10,7 +9,7 @@