Acato
Forum Replies Created
-
Forum: Plugins
In reply to: [WP REST Cache] Record expiryThat is really nice to hear!
Forum: Plugins
In reply to: [WP REST Cache] Record expiryThank you for using our plugin!
I was just about to type that the Expired status could mean that the transient isn’t stored correctly, when I saw your second message that you already found the cause π
Please let us know if we can be of any assistance!
Forum: Plugins
In reply to: [WP REST Cache] Routes aren’t getting cachedHi @sagirika
Thank you for using our plugin!
Just to be clear: with the “cached routes list” you mean the Endpoint API Caches? If you do not see any records there it almost sounds as if the must use plugin isn’t installed (correctly). Can you please check the
/wp-content/mu-pluginsdirectory and see if there is a file calledwp-rest-cache.php?Forum: Plugins
In reply to: [WP REST Yoast Meta] Data missing after updatingHi @falkovic
Thank you for using our plugin!
I have tested the issue you mention, but when I update the Yoast SEO facebook title and description the yoast_meta is updated as well. So unfortunately I cannot reproduce the error.
Is all yoast_meta gone or just the updated parts?To try and help you solve this issue: What did you put in the facebook title and description? And what plugins do you have installed?
Forum: Plugins
In reply to: [WP REST Cache] Set CORS HeadersThank you for using our plugin!
You can indeed manipulate these headers using filters. There are two filters you can use:
wp_rest_cache/cache_headersand/orwp_rest_cache/cache_header. Examples of how to use them:Adding new headers:
function wprc_manipulate_cache_headers( $headers, $request_uri ) { // manipulate the headers here, for example add a Access-Control-Allow-Headers header: $headers['Access-Control-Allow-Headers'] = 'X-Requested-With'; return $headers; } add_filter( 'wp_rest_cache/cache_headers', 'wprc_manipulate_cache_headers', 10, 2 );Manipulate an existing header (can in fact also be done with the
wp_rest_cache/cache_headers, but just as a different example):function wprc_manipulate_existing_cache_header( $header_value, $header_key, $request_uri ) { if( 'Access-Control-Expose-Headers' === $header_key ) { $header_value = 'X-WP-Total'; } return $header_value; } add_filter( 'wp_rest_cache/cache_header', 'wprc_manipulate_existing_cache_header', 10, 3 );Please keep in mind that you should flush the cache in order for these filters to have any effect.
Let us know if this solved your issue or if you need any extra help!
Forum: Plugins
In reply to: [WP REST Cache] Caching through languagesHi @manuelpette
Thank you for using our plugin!
We use MultilingualPress for multilanguage websites (which has it’s own subsite for each language and thus the caching is per subsite), so I do not have any experience with qTranslate X. So unfortunately at this point I do not have an answer to your question and will first have to investigate this.
However: adding the language=[LANGCODE] as a parameter to the call should solve the issue, since a call to
/wp-json/wp/v2/[post_type]should result in a different cache being created than a call to/wp-json/wp/v2/[post_type]?language=[LANGCODE]. So I am a little puzzled as to why both return the cached language. Could you check if indeed two seperate caches are created? You can check by visiting Settings > WP REST Cache > Tab: Endpoint API CachesForum: Plugins
In reply to: [WP REST Cache] Disable a single item cacheHi @redcastor
Thank you for using our plugin!
In order to solve your issue as good as possible, I would like to know a little bit more about the background of your question. Why exactly don’t you want it to be cached?
These caches are flushed automatically whenever the item is edited. So there should be no problem to cache it. What (kind of) data is added to the object at what point that it should not be cached?
Forum: Plugins
In reply to: [WP REST Cache] Automatically cache a flushed cache@euveng It will be a setting to turn on or off the regeneration (not everyone will need it), but also a setting for the time interval.
There isn’t really one hook you can use. Ofcourse there are some hooks we use to determine that a cache needs to be flushed (
save_post,delete_post,edited_term, … ), but this doesn’t tell you which cache is actually flushed (because we flush all related caches and this can be multiple caches if one post is edited). And while typing this I realize we probably should add some hooks ourselves which will be fired when a single cache is flushed.
But even then that will not be enough, because the caches are stored in transients, which expire after a certain amount of time (which you can specify in the settings). When a transient expires, this happens silently and does not trigger any hook. That is why we would do it using a cron job.What this cron job will do is retrieve a list of caches (using
\WP_Rest_Cache_Plugin\Includes\Caching\Caching::get_instance()->get_api_data($api_type, $per_page, $page_number);) and then for each cache which hasis_activeset tofalseregenerate the cache. So you could already implement such a cron job yourself, or wait until we have implemented it πForum: Plugins
In reply to: [WP REST Cache] Caching API v3Hi @machi
First of all: sorry for the late reply! Somehow we did not receive an email when you placed your question.
About your question: it has nothing to do with a v3 API, but with the fact that ACF adds its own endpoints (which is apparently on version 3). At this moment you can register the endpoint for caching (see our Frequently Asked Question section “Can I register my own endpoint for caching?”), unfortunately these caches will not be automatically flushed. However, we do have plans to integrate ACF endpoint caching in our plugin (we also use them a lot) and will then make sure they are flushed automatically.
Forum: Plugins
In reply to: [WP REST Cache] Automatically cache a flushed cacheHi @euveng
Thank you for using our plugin!
At this point there is no method available for regenerating a cache that has just been flushed. We do however have plans to implement a cron job that will regenerate flushed cached on a regular time interval (starting with most requested caches first).
Forum: Plugins
In reply to: [WP REST Cache] Compatibility with other cache pluginsHi @jenilk
I finally have found the time to investigate this issue more thoroughly and have found the cause of the issue when memcached is activated. It has to do with the default expiration setting of 1 year. When memcached is activated, the PHP Memcached class is used. Just like the
set_transient()function of WordPress it has an expiration setting.However for memcached there is a small difference which can make a huge impact: whenever an expiration of more than or equeal to 30 days is used, it is no longer treated as seconds-from-now, but in stead as a unix timestamp. Since 1 year in seconds is a unix timestamp which translates to Fri, 01 Jan 1971 05:48:46, the cache is immediately expired.
So a quick fix would be to set your cache timeout lower than 30 days. Meanwhile we are searching for a better fix, that will allow you to have a cache timeout of more than 30 days.
Forum: Plugins
In reply to: [WP REST Cache] Compatibility with other cache pluginsHi @jenilk
No not yet. I am working on a deadline, so unfortunately I don’t have time to investigate this issue right away. I will let you know once we have investigated the issue and implemented a fix for it.
Forum: Plugins
In reply to: [WP REST Cache] Compatibility with other cache pluginsHi @jenilk
Unfortunately at this point I am not sure what is causing the issue. It is probably related to the issue I got when I unchecked that setting, but I won’t know for sure until I investigate this more thoroughly.
To help me debugging this issue, could you please tell me which cache types you enable in W3 Total Cache? (i.e. Page Cache, OpCode Cache, …) And potentially which Cache Method (Disk / Opcode / Memcached / Redis / ..)
I am sorry I can not help you at this point, but we will investigate and try to solve this as soon as possible.
Forum: Plugins
In reply to: [WP REST Cache] Compatibility with other cache pluginsYou can do so here:
/wp-admin/admin.php?page=w3tc_objectcacheForum: Plugins
In reply to: [WP REST Cache] Compatibility with other cache pluginsWell that was exactly the issue I was getting when I installed W3TC and unchecked the setting ‘Store transients in database’.
The reason you are getting the status
Cache is expired or flushedis because the transient can no longer be retrieved. So somehow the transients aren’t stored correctly.Did you uncheck the setting? If not, than there must be something else that is interfering with the transients.