Title: Plugin speed up
Last modified: October 24, 2017

---

# Plugin speed up

 *  Resolved [malczu](https://wordpress.org/support/users/malczu/)
 * (@malczu)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/plugin-speed-up/)
 * Hi
 * Since I am quite new to WP, could you please recommend the best way to optimize/
   cache results of some endpoints (for example /.well-known/keys/) since it works
   fine but on my current instance it returns keys json in around 1000ms, and we
   have a client which have very specific requirement that response has to be returned
   in under 250ms. I would love to avoid modification of the source code since it
   will make updates much more difficult.
 * Thanks a lot!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Justin Greer](https://wordpress.org/support/users/justingreerbbi/)
 * (@justingreerbbi)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/plugin-speed-up/#post-9616187)
 * Hi and what an awesome topic! We never really thought about caching responses.
   Current there is not a cache feature. Looking at the code now and there is really
   nothing you could do to speed the response up since the return is returning static
   files content basically.
 * Caching would require a DB call which I would assume would be a longer process.
   Allow me some time to look into this feature. If you have any ideas, please share.
 * It sounds like you may benefit from a faster server. What is the actual response
   time of the server compared to the response time of content?
 *  Thread Starter [malczu](https://wordpress.org/support/users/malczu/)
 * (@malczu)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/plugin-speed-up/#post-9616231)
 * Hey, thanks for the fast response. I was thinking about memory cache (maybe key-
   value redis like cache). I have saved /.well-known/keys json as a file and when
   I serve it as a static content it takes 30ms to download by the client, in comparison
   to around 1000ms when keys json is generated. But still /.well-known/openid-configuration/
   points to dynamic /.well-known/keys endpoint so either all auto configured clients
   have to have override for keys endpoint url or I have to modify code to return
   my static file path as keys endpoint url.
 * Thanks!
 *  Plugin Author [Justin Greer](https://wordpress.org/support/users/justingreerbbi/)
 * (@justingreerbbi)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/plugin-speed-up/#post-9616256)
 * I see. Thanks for your feedback. Purhaspse, we could come up with some form of
   Cache but given how the plugin is currently setup, I would not count on an actual
   cache feature just yet.
 * However, I would recommend looking into something like Opcache/ Another HUGE 
   factor is your server environment. PHP 7 is crazy fast compared to 5.6. Also,
   if you are not using NGINX I advise your look into it.
 * The love the idea of caching things like this but right now I am not sure we 
   will be able to provide a valid solution.
 * Wait….
 * You may be able to wright a hook into the `wo_before_api` action. You can then
   do you own request propcess and provide your static files. This will allow you
   to inject you own JSON keys. I am not sure on speed but it is a possibility.
 * At any rate, let me know how it goes. I am always excited to see solutions for
   future support.
 *  Thread Starter [malczu](https://wordpress.org/support/users/malczu/)
 * (@malczu)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/plugin-speed-up/#post-9616323)
 * Cool, thanks a lot for all the recommendations. Will definitely let you what 
   I was able to do to speed it up!
 * Thanks a lot!
 *  Plugin Author [Justin Greer](https://wordpress.org/support/users/justingreerbbi/)
 * (@justingreerbbi)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/plugin-speed-up/#post-9616369)
 * You’re welcome

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Plugin speed up’ is closed to new replies.

 * ![](https://ps.w.org/oauth2-provider/assets/icon-256x256.gif?rev=2603051)
 * [WP OAuth Server (OAuth Authentication)](https://wordpress.org/plugins/oauth2-provider/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/oauth2-provider/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/oauth2-provider/)
 * [Active Topics](https://wordpress.org/support/plugin/oauth2-provider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/oauth2-provider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/oauth2-provider/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [keys](https://wordpress.org/support/topic-tag/keys/)
 * [speed](https://wordpress.org/support/topic-tag/speed/)

 * 5 replies
 * 2 participants
 * Last reply from: [Justin Greer](https://wordpress.org/support/users/justingreerbbi/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/plugin-speed-up/#post-9616369)
 * Status: resolved