Acato
Forum Replies Created
-
Forum: Plugins
In reply to: [WP REST Cache] build_request_uri not store correct request uriHi @redcastor
Our latest releases of the plugin now solves this issue.
Forum: Plugins
In reply to: [WP REST Cache] Possible to add a filter for cache_key in build_request_uriHi @redcastor
We have decided to do it slightly different than your implementation, but you are now able to specify request headers for caching. See the new FAQ entry for more details.
Forum: Plugins
In reply to: [WP REST Cache] Disable a single item cacheHi @redcastor
We just released a new version of our plugin. For several reasons and the fact that the Item API Cache wasn’t adding a real performance boost, we have decided to remove it completely. So I would say that also solves your problem, right?
Forum: Plugins
In reply to: [WP REST Yoast Meta] Return Open Graph Data via API?Hi @antonemery
Thank you for using our plugin!
As you say so yourself, it is working on your local test blog. There is no reason why it would not work on your dev production blog. Are you sure you filled out the correct settings in Yoast?
Forum: Plugins
In reply to: [WP REST Cache] Question about custom endpointsHi,
Hmm too bad, because that would be the easy explanation π
Just to be sure some questions:
- Are you doing a GET-request? Only GET-requests get cached.
- Can you check your database in the wp_options table for the values where option_name =
wp_rest_cache_rest_prefixandwp_rest_cache_allowed_endpoints? If either one of these is empty (or not filled correctly) it will cause caching to be skipped.
If none of the answers to these questions provide some insight into why the call isn’t cached, please try and disable the plugin and do a call to the REST API. Check what HTTP Status code you get back from the API, if it isn’t 200 than that is why it isn’t cached.
Forum: Plugins
In reply to: [WP REST Cache] Question about custom endpointsHi @mighty_mt
This might occur when the setup of the plugin was unable to copy its Must Use plugin to the correct directory. To fix this you can copy it manually from
/wp-content/plugins/wp-rest-cache/sources/wp-rest-cache.phpto/wp-content/mu-plugins/wp-rest-cache.phpForum: Plugins
In reply to: [WP REST Cache] Question about custom endpointsHi @mighty_mt
Thank you for using our plugin!
The kind of (JSON-)data in the endpoint doesn’t matter for the WP REST Cache plugin. However, the plugin will not always be able to determine the type of data and cache it as type ‘unknown’. You can help the plugin to determine the data type by using the
wp_rest_cache/determine_object_typefilter. At this point it doesn’t matter that much that the plugin cannot determine the data type. But in a future release we will add code to flush the data type ‘unknown’ very frequently, because it can cause some errors.But back to your issue: I have tested your dummy plugin on a clean WordPress installation with only your plugin and the WP REST Cache plugin activated. And the endpoint is cached correctly. So either you are doing something slihtly different than in your dummy plugin or some other plugin is causing some problems.
Please let me know if we can be of any more assistance!
Forum: Plugins
In reply to: [WP REST Cache] How to exclude specific itemsHi @holaeffect
It is still a work in progress and we are brainstorming how it should actually work / where you can do the settings exactly), but the general idea is this:
In the settings of the plugin you can set which request headers should be used (or possibly via a hook so you can set it per endpoint).
So if for instance you are sending a header
WPLANG(to set which language should be returned), you then set it as cacheable header. And each time you do a request to the WP REST API, the caching plugin will check if there is already a cache record for the requested url combined with the correctWPLANGheader.
So a call to/wp-json/wp/v2/postswith request headerWPLANGset toen_USwill result in a different cache than a call to the same url/wp-json/wp/v2/postsbut with the request headerWPLANGset tonl_NL.What you want could be quite hard (maybe even impossible) to implement correctly. You want specific items not to be cached. But what if that item is one of the items returned by the
/wp-json/wp/v2/postsendpoint? That would mean we cannot cache that endpoint at all?
I am going to think about it a bit more, to see if maybe we can come up with a workable solution for this.Forum: Plugins
In reply to: [WP REST Cache] How to exclude specific itemsHi @holaeffect
Thank you for using our plugin!
We are working on a new feature where you can have certain request headers be used to distinguish between seperate caches, maybe that can help?
Until that feature is released there are some possible fixes:
- Remove the endpoint from caching at all, although that might be too much for you.
- Adding
?skip_cache=1to your request will make it not use cache at all, so you could for instance add it to calls by a member. - Maybe you can add a dummy-parameter to distinguish between members and non-members? I.e. you could add
?member=1or?member=0, each parameter added will create a different cache record
I know these aren’t really nice solutions, so please let me know if the feature I described (about using request headers to distinguish between seperate caches) can help you. Because if it cannot help you maybe we can think of a different solution we could implement.
Forum: Plugins
In reply to: [WP REST Cache] Support for the _embed query paramHi @davidrouyer
Thank you for letting us know you solved it! And please let us know if we can be of any more assistance.
Forum: Plugins
In reply to: [WP REST Cache] Support for the _embed query paramHi @davidrouyer
Well that aren’t much plugins, so little change any of the other plugins is causing this. I will try and debug it myself too, but unfortunately that will be somewhere next week. So please let me know if you find something, so we can see if we can deploy a fix for it π
Forum: Plugins
In reply to: [WP REST Cache] Support for the _embed query paramHi @davidrouyer
Sorry to ask, but if it breaks randomly how can you be sure it is because of the plugin?
I have searched through the WordPress core, specifically the part where the _embed parameter is processed. But unfortunately I can not find any clue as to why our plugin would break this functionality. As a matter of fact I have tried to reproduce it on my local test-environment, but whatever I do (with or without the plugin activated) it simply always works. Especially the randomness of the issue, makes it really hard for me to explain.
I would like to help you debug this issue, but at this point I really need more information: what plugins do you have installed (and which are activated)? What theme? How do you make the call to the REST API? Are you sending any extra headers?Forum: Plugins
In reply to: [WP REST Cache] Support for the _embed query paramHi @davidrouyer
It appears that your setup doesn’t always correctly include the _embedded. If I take your example: https://staging.wp.hopfab.com/wp-json/wp/v2/projects?slug=agencement-surmesure-bureaux-alter-solution&_embed and add
&skip_cache=1to (that will force it to NOT use cache) I also don’t see the _embedded. So if it isn’t generated it can not be cached πAs I said, the plugin isn’t doing anything to prevent the _embed parameter to work. As a matter of fact the very simple explanation of how it does the caching is:
Is there a cache available?
– Yes? > Return cache
– No? > Let WordPress process the request as it would normally do (including handling all query parameters) and cache the result.
So the first time the cache is created it is all handled by WordPress, the plugin doesn’t do anything to the results of the call.Forum: Plugins
In reply to: [WP REST Cache] Support for the _embed query paramHi @davidrouyer
Thank you for using our plugin!
The plugin is doing nothing to prevent the _embed query parameter from working. As a matter of fact, we ourselves are using this query parameter quite a lot in combination with our plugin. I just tested it on one of our headless sites and it is working correctly and also being cached correctly.
I visited the urls you provided, but it appears you no longer have the plugin activated, since I don’t see theX-WP-Cached-Callresponse header.Forum: Plugins
In reply to: [WP REST Yoast Meta] Data missing after updatingHi @neufeld
Clear, the title you can set there is the same as the
og:title. On a non-headless website Yoast SEO also manipulates the <title>-tag to change it to that title. We have however not yet implemented it to also change the title in the default REST API response, since at first we only wanted to add the actual <meta>-tags. I will add it to a list of possible improvements for the future. For now you could use theog:titlesince it is exactly the same value.