Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Javier Calvarro Nelson 51838a26a5
[Blazor] Adds compresion support for all assets in an application (#55558)
Adds a new MapStaticAssetEndpoints routerware that reads a manifest generated at build / publish time and maps the endpoints defined in the manifest to the files in the application wwwroot folder.

Adds a MatcherPolicy to perform content negotiation based on the Accept-Encoding header. Compressed resources contain a ContentEncoding attribute in their metadata that is used to filter out the compressed asset to serve to the client based on the Accept-Encoding header.

The content encoding has an associated Quality value that represents the 'server preference' for the encoding. We always use the client preference and only rely on the server preference to break ties.

This process is completely driven by de the build and transparent to the runtime, if in the future we add support for zstd, sbr, etc. we don't need to change the runtime.

The logic for serving static files is borrowed from the static files middleware, with simplifications and additions. I've ported the relevant tests to ensure a high degree of compatibility.

The logic is new "routerware" instead of directly baked into the static files middleware because we do not want to pollute that middleware with more complex logic and we are going to be layering fingerprinting on top of this change, which will register more endpoints that will include more custom headers, which is not suitable for the static files middleware.

During development we wrap the endpoints we generate to support changing the files while the app is running (we recompute some of the values on the fly and also register a fallback route that matches file patterns to serve new files added while the app is running).

The build/publish process computes all the required information about the assets that is used to emit the response. The ETag and Last-Modified values are computed using the Base64(SHA256) hash of the content and the LastWrite on the file at build/publish time.
2024-05-13 18:04:54 +02:00
Marc Gravell 48dd6a9e0b
Add HybridCache public API (#55084)
* initial API cut (post review)

---------

Co-authored-by: Andrew Casey <amcasey@users.noreply.github.com>
Co-authored-by: Brennan <brecon@microsoft.com>
Co-authored-by: joegoldman2 <147369450+joegoldman2@users.noreply.github.com>
2024-04-17 14:29:38 +01:00
Marc Gravell c65d9a1cc1
Split redis output-cache pieces from Microsoft.Extensions.Caching.StackExchange.Redis into Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (#50457)
* split SE.Redis OutputCache implementation into new package, Microsoft.AspNetCore.OutputCaching.StackExchangeRedis
(it was causing an undesirable framework ref)

- remove the output cache functionality and ref from Microsoft.Extensions.Caching.StackExchange.Redis
  - (simplified API [un]shipped.txt back to single; no change except no more unshipped)
- moved functionality to new package (and update eng files accordingly)
- new namespace etc; will need API review
- in particular, RedisCacheOptions was shared between both APIs; now RedisOutputCacheOptions

* update tags

* add a startvs.cmd

* remove ExcludeFromSourceBuild

* revert shipped/unshipped to make CI happy

* keep public API file position to minimize PR size

* seal RedisOutputCacheOptions

* file named incorrectly

* unnecessary using directive

* remove IOptions<T> from RedisOutputCacheOptions (required using DI in the tests)
2023-09-11 13:09:24 -07:00
William Godbe 3546c1659d
Create transport package for API docs (#49969)
* Create transport package for API docs

* Build.props

* Skip restore

* Fixup

* No ProjRef

* Update Microsoft.Internal.Aspnetcore.DotNetApiDocs.Transport.csproj

* Update Helix.targets

* Update Helix.targets

* Update Microsoft.Internal.Aspnetcore.DotNetApiDocs.Transport.csproj

* Update Microsoft.Internal.Aspnetcore.DotNetApiDocs.Transport.csproj

* Feedback
2023-08-10 11:02:03 -07:00