Bug 143200

Summary: Use st_mtime instead of st_atime to track file access time
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch darin: review+

Description Antti Koivisto 2015-03-29 16:24:49 PDT
On OS X atime updates automatically so calling Storage::traverse() always ends up updating all access times. We update mtime manually on successful cache retrieve only.
Comment 1 Antti Koivisto 2015-03-29 16:34:26 PDT
Created attachment 249701 [details]
patch
Comment 2 Darin Adler 2015-03-29 16:36:35 PDT
Comment on attachment 249701 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249701&action=review

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:592
> +    // Modificiation time is updated on read. Don't use access time since OS may update it automatically on any read.

Typo: Modificiation

Comment is unclear. When you say “is updated on read” you mean “is updated by WebKit cache code when it reads an item from the cache”, but it sounds like “is updated by the file system when any process reads the file”.
Comment 3 Antti Koivisto 2015-03-29 16:45:23 PDT
https://trac.webkit.org/r182124
Comment 4 Andreas Kling 2015-03-30 10:54:41 PDT
Mild LOL at this bug. atime rarely does what anyone really wants :|
Comment 5 Antti Koivisto 2015-03-30 11:17:53 PDT
Wish there was at least a way to disable automatic atime updates for cache files. It is semantically nice.