Question

Recently i was testing site performance on PageSpeed, where i came to know that we have Landing page issues, here's what PageSpeed told us:

To speed up page load times for visitors of your site, remove as many landing page redirections as possible, and make any required redirections cacheable if possible.

It further says:

http://www.avnetwork.com/ is a non-cacheable redirect to http://www.avnetwork.com/index

Can anyone tell me how to cache the redirects in asp.net

Était-ce utile?

La solution

Programatically you can try something like this:

Response.Cache.SetExpires(DateTime.Now.AddDays(1));
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.Cache.SetValidUntilExpires(true);
Response.AddHeader("Vary", "User-Agent, Accept-Encoding");
Response.Redirect("http://www.avnetwork.com/index");
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top