【问题标题】:How to geenrate or customise http headers如何生成或自定义 http 标头
【发布时间】:2014-02-10 04:17:43
【问题描述】:

我正在使用 AzureReader2 调整我从 azure blob 请求的图像大小,调整大小工作正常。

下面是我的代码,足以使用 AzureReader2 插件从 azure 调整图像大小

<resizer>
    <plugins>
      <add name="MvcRoutingShim" />
        <add name="AzureReader2" connectionString="DefaultEndpointsProtocol=https;AccountName=xxxxxx;AccountKey=xxxxxxx" endpoint="http://xxxxxxx.blob.core.windows.net/" />
    </plugins>
  <clientcache minutes="2880" />
  </resizer>

但我想通过我的 webCofig 文件配置设置自定义 http 标头,例如 ETagLast-ModifiedCache-Control 选项。我觉得很难继续。

因此,任何用于生成和自定义上述选项的指针或解决方法或线索。

【问题讨论】:

  • 您使用的代码在哪里?
  • 因为,我使用的是插件,所以我在 webconfig 文件中的问题中向您展示了几行代码来注册配置。

标签: asp.net-mvc-4 http-headers azure-storage imageresizer


【解决方案1】:

您正在使用 IIS,因此请使用 IIS 对缓存控制的内置支持。

IIS7 Cache-Control

通过磁盘缓存,IIS 通常会覆盖 ImageResizer 设置的任何缓存标头(例如通过“分钟”设置的 Expires 标头),因此无论如何它也无能为力。

【讨论】:

    猜你喜欢
    • 2017-03-16
    • 2013-05-15
    • 2012-01-17
    • 2012-09-22
    • 2018-09-26
    • 2011-12-09
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    相关资源
    最近更新 更多