0

I've had quite a few goes at Googling an answer to this, but have been unable to find one that satisfies the question.

I'm using C# with web forms. I have many opportunities to cache pages such as Privacy, Terms etc, since they hardly ever change.

However, I'm unsure on the effect of javascript when combined with output caching. I understand about fragment caching, donut caching et al, but with Ajax, jQuery and now Polymer, this client side stuff isn't going anywhere.

So can output caching be used in tandem with client side technologies or has the facility to use output caching now disappeared forever?

John Ohara
  • 2,821
  • 3
  • 28
  • 54
  • `OutputCache` is caching the data from your *server*. If you write Javascript which pulls data from that server, you'll still want to use OutputCache so the server doesn't need to regenerate the HTML. – CodingIntrigue Apr 13 '15 at 12:14

2 Answers2

0

Sure you can use Web.Forms output caching and non-cached Ajax requests together, for example making an Ajax request you can easily add some parameter to JS AJAX request that will be filled with current timestamp:

GET http://example.com/api?method=getUsers&_t=1428927438

Each API call has unique variable/parameter that prevents caching

Andrii Tsok
  • 1,386
  • 1
  • 13
  • 26
0

If anything, it's even easier.

Using client-side script allows the combination of different elements with different cache policies on the same page.

Jon Hanna
  • 110,372
  • 10
  • 146
  • 251