Already did, ticket ID is: 60842 🙂
On one hand, there maybe a way to implement this in dispatcher (I also suggested this in the ticket):
#####
Dispatcher support for last-modified
The dispatcher should be changed so that it can handle and store 2 timestamps for every file it caches:
the last-modfied timestamp of the content (e.g. the time when the content data was last changed)
a last-cached timestamp it uses for purposes of dispatcher cache auto-invalidation
Since most Unix file systems have no created date for a file, at least one of the two timestamp meta data mentioned needs to be stored somehow. Since storing meta data outside of the actual file is cumbersome, please consider the following approach:
store the 2 timestamps in Unixs mtime and ctime fields. Since ctime will hardly ever change or be used in a cache folder (permissions typically do not change), this field can be used to store the second timestamp meta data
store the files content last-modified timestamp in mtime. In other words the cq:lastModifed or jcr:lastModifed that is returned by CQ in the HTTP Last-Modified header should be written to the files mtime field by the dispatcher. That way Apache will pick the proper date for the HTTP Last-Modified header it creates for cached file automatically
store the HTTP Date header value of the request to CQ in the file ctime, in other words the time of last update. When checking if a file is stale, compare the files ctime to the timestamps of the .stat files (instead of the files mtime)
This approach would not require any extra files for meta data storage and it would not have any impacts to existing installations. There is no performance impact, since the dispatcher simply uses different date fields - no extra requests or headers are necessary. Also there is no functional impact, since the file permissions typically do not change in the cache folder other than at file creation time.
See also:
http://superuser.com/questions/387042/how-to-check-all-timestamps-of-a-file
http://www.unix.com/tips-and-tutorials/20526-mtime-ctime-atime.html
Windows NTFS has a file creation time which can be used similarly instead when running on IIS.
#####
I admit this is something of a hack though, and more and more I am coming to the conclusion that Varnish is the better dispatcher anyway.
It allows far more flexibility in caching and especially flushing, as it supports full regexes where the dispatcher just has simple patterns (apart from a dozen other advantages).
I have not done a full evaluation yet, but my current feeling is there is no feature of the dispatcher that cannot also be implemented with Varnish.
Having said that, are there any thoughts at Adobe to get rid of the dispatcher altogether and make Varnish the "official" suggested caching layer/plugin? Alternatively, how about open sourcing the dispatcher code or at least making the source available? (there have been some occasions where I wanted to know what exactly goes on under the hood and reverse-engineering is cumbersome)