Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hallatore/mvcoptimizations
Performance utilities for MVC4 applications
https://github.com/hallatore/mvcoptimizations
Last synced: 19 days ago
JSON representation
Performance utilities for MVC4 applications
- Host: GitHub
- URL: https://github.com/hallatore/mvcoptimizations
- Owner: hallatore
- Created: 2013-04-18T21:14:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-06T17:17:19.000Z (almost 11 years ago)
- Last Synced: 2024-12-05T08:05:47.138Z (about 1 month ago)
- Language: C#
- Size: 164 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Author: Tore Lervik - http://mindre.net
Download: https://nuget.org/packages/MvcOptimizations or ```PM> Install-Package MvcOptimizations```
# Documentation
## HtmlMinifierAttribute
Minifies the html-output to remove whitespace. Usually removes 15-20% of the content on MVC pages and only has about 1ms overhead. The filter will only trigger when the content type is text/html.
```csharp
[HtmlMinifier]
public ActionResult Index() { ... }// or
filters.Add(new HtmlMinifierAttribute());
```## CompressFilterAttribute
Used on JsonResult because Mvc doesn't gzip Json-output. Can also be used on other actions that doesn't compress by default.
```csharp
[CompressFilter]
public JsonResult Articles() { ... }
```## Utilities.Cache
Helper method for easier object caching.
```csharp
var articles = MvcOptimizations.Utilities.Cache("Articles", TimeSpan.FromMinutes(10), () =>
{
var result = Service.GetArticles();
SortArticles(result);
return result;
});
```