如何将.htaccess文件添加到我的Visual Studio解决方案

编程入门 行业动态 更新时间:2024-10-28 06:25:33
本文介绍了如何将.htaccess文件添加到我的Visual Studio解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要添加 Expires 标头-在谷歌搜索时,我从此链接。但是该文件位于何处?是否可以将其添加到我的Visual Studio解决方案中?

My need is to Add Expires headers - while Googling I got the solution from this link. But where this file is located? Is it possible add it to my Visual Studio solution? Is it necessary to refer such file in master page?

推荐答案

如果要使用以下方法在IIS中为静态内容设置Expires标头,是否有必要在母版页中引用该文件?您需要在web.config中执行ASP.NET。我曾在此处。

If you want to set an Expires header for static content in IIS with ASP.NET you need to do it in the web.config. I blogged about this a while back here.

但这是将默认7天有效期添加到以下地址的代码:< system.webServer> 节点

But here is the code to add a default 7 day expiration to the <system.webServer> node of your web.config.

<staticContent> <clientCache cacheControlMaxAge="7.00:00:00" cacheControlMode="UseMaxAge" /> </staticContent>

更多推荐

如何将.htaccess文件添加到我的Visual Studio解决方案

本文发布于:2023-11-15 11:23:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1593994.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   解决方案   文件   htaccess   Visual

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!