2

Using the excellent Wordpress plugin, JSON API, I've created an application that retrieves fresh data by visiting a URL along the following lines, doing a Unix curl dump.

http://www.website.net/?json=get_recent_posts&post_type=tree&count=200

The problem is this: Because the site delivers cache versions using W3 Total Cache, the stuff that gets curled is inconsistent. Sometimes I get the JSON that I need. Other times I just get a cache showing me "website.net"'s front page, without the effects of the query string.

I'm hoping to do one of two things:

1) Find a way for my request to bypass w3 Total Cache. But how? Is there something I can put into the query string that will tell Wordpress to give me a fresh page read and not a cache?

If that can't work,

2) Get the plugin data through PHP rather than through the RESTful Web request. But I only know how to use JSON API for Web URL calls and not for using the JSON data internally.

Any help much appreciated. I also thought that maybe W3TC's function to cache query string results might work, but I can't figure it out.

1 Answer 1

1

If you are using page cache using disk enhanced in w3tc settings, the URL with query strings will not cached. I think this solves your problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.