1

I am setting up a webservice on azure and I need to cache images that are being generated by the ASP.NET chart control to the client so that when the back button is pressed or the refresh button is clicked, the image will load from the cache instead of it re-loading from the web-server.

I am getting private as the "Cache-control" response. How do I update the http response settings to make this cached?

Here are my settings in my web.config file and screen shots of the image in firebug. Thanks!

  <appSettings>
    <add key="ChartImageHandler" value="Storage=file;Timeout=60;Url=~/tempImages/;webDevServerUseConfigSettings=true; deleteAfterServicing=false;"  />
  </appSettings>

    <httpHandlers>
      <add verb="GET" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="true" />
    </httpHandlers>   

  <system.webServer>
    <handlers>
      <add name="ChartImageHandler" verb="*" preCondition="integratedMode" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </handlers>
  </system.webServer>

https://i.stack.imgur.com/EK6uy.png

https://i.stack.imgur.com/BP2U6.png

TWilly
  • 4,863
  • 3
  • 43
  • 73

0 Answers0