Adds a UrlHelper.VersionedContent
URL extension helper to append SHA256 hash to content URLs in ASP.NET MVC 5.
Install-Package AspNet.Mvc.AssetVersioning
In Views/web.config
, add:
<configuration>
...
<system.web.webPages.razor>
<pages ...>
<namespaces>
...
<add namespace="System.Web.Mvc.AssetVersioning"/>
</namespaces>
</pages>
</system.web.webPages.razor>
</configuration>
You can then use the helper in .cshtml
files like so:
<script type="text/javascript" src="@Url.VersionedContent("~/scripts/jquery.js")"></script>
And the helper will append a query string parameter containing the SHA256 hash of the content. This is cached for the lifetime of the request cache (HttpContext.Cache
).
版本控制 (Versioning) 对接口进行版本控制只是一种杀死已部署客户端的 “礼貌” 方式。—— Roy Fielding API 版本控制允许您更改不同客户端之间的行为。REST framework 提供了许多不同的版本控制方案。 版本控制由传入的客户端请求决定,并且可以基于请求 URL,也可以基于请求头。 有许多有效的方法来处理版本控制。非版本化的系统也可能是合适的,特别是如果您正在为超
Asset Pipeline 本文介绍 Asset Pipeline。 读完本文,你将学到: Asset Pipeline 是什么以及其作用; 如何合理组织程序的静态资源; Asset Pipeline 的优势; 如何向 Asset Pipeline 中添加预处理器; 如何在 gem 中打包静态资源; 1 Asset Pipeline 是什么? Asset Pipeline 提供了一个框架,用于连
Asset Packagist Composer + Bower + NPM = friends forever! This package is the core part of https://asset-packagist.org/ project. Asset Packagist allows installation of Bower and NPM packages as native
NPM/Bower Dependency Manager for Composer The Composer Asset Plugin allows you to manage project assets (css, js, etc.) in your composer.jsonwithout installing NPM or Bower. This plugin works by trans
Ember Asset Loader Provides experimental support for the Asset Manifest RFC and Asset Loader Service RFC. Usage Ember Asset Loader does three primary things: Provides a base class to easily generate a
pwa-asset-generator ✨ Automates PWA asset generation and image declaration. Automatically generates icon and splash screen images, favicons and mstile images. Updates manifest.json and index.html file
Hexo 本地图片插件可以转换图片相对路径 为 asset_img,使用本插件即可实现 Typora 等 Markdown 编辑器预览与 Hexo 发布预览均能正常显示图片。 使用 npm install hexo-asset-img --save hexo-typora├── apppicker.jpg├── logo.png└── rules.jpghexo-typora.md Make su