/* * Init code used when we are running a precompiled app */ private void PrecompiledAppRuntimeModeInitialize() { // // Initialize the caches // // Always try the memory cache first _memoryCache = new MemoryBuildResultCache(HttpRuntime.CacheInternal); // Used the precomp cache for precompiled apps BuildResultCache preCompCache = new PrecompiledSiteDiskBuildResultCache( HttpRuntime.BinDirectoryInternal); // Also create a regular disk cache so that we can compile and cache additional things. // This is useful even in non-updatable precomp, to cache DefaultWsdlHelpGenerator.aspx. _codeGenCache = new StandardDiskBuildResultCache(HttpRuntime.CodegenDirInternal); _caches = new BuildResultCache[] { _memoryCache, preCompCache, _codeGenCache }; }
/* * Init code used when we are precompiling an app */ private void PrecompilationModeInitialize() { // We are precompiling an app // Always try the memory cache first _memoryCache = new MemoryBuildResultCache(HttpRuntime.CacheInternal); // Create a regular disk cache, to take advantage of the fact that the app // may already have been compiled (and to cause it to be if it wasn't) _codeGenCache = new StandardDiskBuildResultCache(HttpRuntime.CodegenDirInternal); // Create a special disk cache in the target's bin directory. Use a slightly different // implementation for the updatable case. string targetBinDir = Path.Combine(_precompTargetPhysicalDir, HttpRuntime.BinDirectoryName); BuildResultCache preCompilationCache; if (PrecompilingForUpdatableDeployment) { preCompilationCache = new UpdatablePrecompilerDiskBuildResultCache(targetBinDir); } else { preCompilationCache = new PrecompilerDiskBuildResultCache(targetBinDir); } _caches = new BuildResultCache[] { _memoryCache, preCompilationCache, _codeGenCache }; }
/* * Init code used when we are running a non-precompiled app */ private void RegularAppRuntimeModeInitialize() { // // Initialize the caches // // Always try the memory cache first _memoryCache = new MemoryBuildResultCache(HttpRuntime.CacheInternal); // Use the standard disk cache for regular apps _codeGenCache = new StandardDiskBuildResultCache(HttpRuntime.CodegenDirInternal); _caches = new BuildResultCache[] { _memoryCache, _codeGenCache }; }