0

We currently cache our homepage. However, there is a section of the homepage we don't want cached, because it changes anywhere from a 1/2 hour to 3 hours.

Is there a way to write my code in PHP so that this one section doesn't get cached?

Is this even possible?

Thanks!

Yazmin
  • 1,154
  • 5
  • 17
  • 34

2 Answers2

0

Not with a full-page cache like W3TC, but you can use JavaScript to hide that section if JavaScript is available and pull in fresh content over AJAX. That way, people with JavaScript disabled will still see the older content but everyone else will get fresh content.

Dave Ross
  • 3,313
  • 1
  • 24
  • 21
0

What I am looking to do is actually called Fragment Caching.

Here's a link for anyone else who needs this solution in conjunction with the W3TC plugin:

http://www.contrid.co.za/2015/05/w3-total-cache-fragment-caching/

Yazmin
  • 1,154
  • 5
  • 17
  • 34