Hi all i have an aciton in my controller which generates an sitemap for my site, the problem here is for the first time when the file not exists the request goes to the action but once the file is generated , a static file is placed in the site , after that when i hit the URL the request is not going to the controller , is there a fix for this
Below is the URL
http://localhost:1234/sitemap.xml
Below is the code am using
[HttpGet, ActionName("sitemap")]
public ActionResult sitemap()
{
//will get the sitemap content here and will generate the sitemap
var sitemapFile = "~/sitemap.xml";
return File(sitemapFile, "text/xml");
}
Every time i hit the URL it should go to the action and regenerate the file , but this is not working here can any one help me out