Fixed cacheDir handling under Windows and Mime type detection for remote files