WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
w3 total cache & json api (4 posts)

  1. skhfw
    Member
    Posted 2 years ago #

    is there a way to cache anything that is behind lets say the folder /api/

    caching plugin is w3 total cache

    http://wordpress.org/extend/plugins/json-api/

  2. sf_mike
    Member
    Posted 2 years ago #

    Did you get an answer on this? CDN url rewriting rules in w3 total cache are ignored by the json api as well. I'd love to see them working together nicely.

  3. Frederick Townes
    Member
    Posted 2 years ago #

    Not by default in the plugin. The plugin only caches xml/html based pages. To support JSON data one needs to add and write a check for that in PageCache ob_callback. The use case has been noted however.

  4. alexanderjohansson
    Member
    Posted 2 years ago #

    I solved this, although it's not a perfect solution, but it works for now

    I replaced if ($buffer != '' && w3_is_xml($buffer)) in PgCache.php with
    if ($buffer != '' && (w3_is_xml($buffer) || w3_is_json($buffer) || w3_is_jsonp($buffer)))

    The w3_is_json-stuff looks like this at the moment: https://gist.github.com/3349372

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic