WP Super Cache
Super Cache + JSON (3 posts)

  1. jdfcafe
    Posted 4 years ago #


    I installed WP Super Cache. It works fine except for one case.

    Let's say I have a special page that gathers some information about some posts and outputs them in JSON (array of JSON objects). That page (e.g. mydomain.com/regulations/ch4/) is used by some other websites that get and execute its content as JavaScript (jQuery.ajax() with dataType set to 'script'). Unfortunately, such requests don't create a cached version of this page.

    I looked into the code of SuperCache and found out that it examines wp pages and looks for certain tags. If it finds them, it creates their cache version. So I added
    to workaround this (but I honestly hate this solution), and it started generating cached versions when the url was accessed from the browser, but not from jQuery.ajax() :/

    Any ideas?


  2. jdfcafe
    Posted 4 years ago #


  3. Donncha O Caoimh
    Plugin Author

    Posted 4 years ago #

    You're right about why this isn't working. It's to stop half generated pages being cached. I'm not sure why it's not being cached when called from the ajax command. Did you try the debug system in the plugin?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic