0

Is there any way to implement Page Caching for some certain URL pattern? For example, I have articles on my ASP.NET website and they don't changed so frequently. All of them have a URL pattern as following:

www.myite.com/articles/article1.aspx

www.myite.com/articles/article2.aspx

www.myite.com/articles/article3.aspx

and so on.

I want them all to be cached for 24 hours at least on server. How do I do it? Any help.

Sunny Sharma
  • 4,688
  • 5
  • 35
  • 73

1 Answers1

2

I would suggest you should have a look into Output Caching. This feature can help you achieve caching of pages and display content for less frequently changing pages.

Some good links on Output Caching :

MSDN : Output Caching

Output Caching Information

Also, for caching the pages that follow a specific URL pattern, you can either do that individually(which is quite obvious) and you can have a look into the <location> attribute available in the web.config which can help you configure various settings for specific directory that you specify in it. Of course, cache settings are also available inside the child tags for this tag.

This link might point in the right direction :

Set cache to a folder in web.config

Hope this helps.

Community
  • 1
  • 1
Dhrumil
  • 3,221
  • 6
  • 21
  • 34
  • thanks @matt... seems the right pointer. Will be back shortly to mark that as an answer. – Sunny Sharma Dec 07 '15 at 06:43
  • @Sunny - No probs brother. Here to help. Let me know how it works out. – Dhrumil Dec 07 '15 at 06:45
  • @SunnySharma: Did you implemented it? I also have same situation. I have more than 30 pages, and same url pattern. I don't want to cache each page indivually. – Amit Kumar Jan 06 '17 at 13:17
  • @AmitKumar I did it by separating contents into Master/Child forms and applied Output Cache inside Master Page's certain ContentPlaceHolders. – Sunny Sharma Jan 08 '17 at 10:39