@@ -47,14 +47,11 @@ public PhysicalFileSystemCache(
4747#endif
4848 FormatUtilities formatUtilities )
4949 {
50+ Guard . NotNull ( options , nameof ( options ) ) ;
5051 Guard . NotNull ( environment , nameof ( environment ) ) ;
51- Guard . NotNullOrWhiteSpace ( environment . WebRootPath , nameof ( environment . WebRootPath ) ) ;
52-
53- // Allow configuration of the cache without having to register everything
54- PhysicalFileSystemCacheOptions cacheOptions = options != null ? options . Value : new ( ) ;
55- this . cacheRootPath = GetCacheRoot ( cacheOptions , environment . WebRootPath , environment . ContentRootPath ) ;
56- this . cacheFolderDepth = ( int ) cacheOptions . CacheFolderDepth ;
5752
53+ this . cacheRootPath = GetCacheRoot ( options . Value , environment . WebRootPath , environment . ContentRootPath ) ;
54+ this . cacheFolderDepth = ( int ) options . Value . CacheFolderDepth ;
5855 this . formatUtilities = formatUtilities ;
5956 }
6057
@@ -67,9 +64,7 @@ public PhysicalFileSystemCache(
6764 /// <returns><see cref="string"/> representing the fully qualified cache root path.</returns>
6865 internal static string GetCacheRoot ( PhysicalFileSystemCacheOptions cacheOptions , string webRootPath , string contentRootPath )
6966 {
70- string cacheRoot = string . IsNullOrWhiteSpace ( cacheOptions . CacheRootPath )
71- ? webRootPath
72- : cacheOptions . CacheRootPath ;
67+ string cacheRoot = cacheOptions . CacheRootPath ?? webRootPath ?? "wwwroot" ;
7368
7469 return Path . IsPathFullyQualified ( cacheRoot )
7570 ? Path . Combine ( cacheRoot , cacheOptions . CacheFolder )
0 commit comments