code: public static TileCache createTileCache(int tileSize, double overdrawFactor, int capacity, File cacheDirectory) {
          int cacheSize = getMinimumCacheSize(tileSize, overdrawFactor);
          TileCache firstLevelTileCache = new InMemoryTileCache(cacheSize);
          TileCache secondLevelTileCache = new FileSystemTileCache(capacity, cacheDirectory, AwtGraphicFactory.INSTANCE);
          return new TwoLevelTileCache(firstLevelTileCache, secondLevelTileCache);
      }
docs: Utility function to create a two-level tile cache with the right size, using the size of the screen.
  <p>
  Combine with <code>FrameBufferController.setUseSquareFrameBuffer(false);</code>
  
  @param tileSize       the tile size
  @param overdrawFactor the overdraw factor applied to the map view
  @param capacity       the maximum number of entries in file cache
  @param cacheDirectory the directory where cached tiles will be stored
  @return a new cache created on the file system