{"id":2762,"date":"2023-02-12T12:20:21","date_gmt":"2023-02-12T04:20:21","guid":{"rendered":"https:\/\/gergely.imreh.net\/blog\/?p=2762"},"modified":"2023-02-12T18:49:51","modified_gmt":"2023-02-12T10:49:51","slug":"when-wordpress-caching-is-not-what-it-seems","status":"publish","type":"post","link":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/","title":{"rendered":"When WordPress caching is  not what it seems"},"content":{"rendered":"\n<p>When parts of a system are strongly interconnected, one can discover latent issues while debugging something completely different. This is what happened with this blog&#8217;s caching and integrating with the Fediverse.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fediverse adventures<\/h2>\n\n\n\n<p>I was part of The Great Twitter Exodus of 2022, and like many I&#8217;ve landed on <a href=\"https:\/\/joinmastodon.org\/\">Mastodon<\/a> (hey, hello, <a href=\"https:\/\/fosstodon.org\/@imrehg\">https:\/\/fosstodon.org\/@imrehg<\/a>). Mastodon and the whole <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fediverse\">Fediverse<\/a> and its build around the <a href=\"https:\/\/w3c.github.io\/activitypub\/\">ActivityPub<\/a> protocol is technically very interesting and brings back a bit of retro-joy to me (which needs some reflections on why and how is retro joyful, but another time). This current blog is running <a href=\"https:\/\/wordpress.org\/\">WordPress<\/a>, and soon found that there&#8217;s <a href=\"https:\/\/wordpress.org\/plugins\/activitypub\/\">a plugin to turn a WordPress blog into a my own ActivityPub node<\/a>. That seemed some excellent way to connect up tools and make a more inter-connected Internet (besides nerding out, if I&#8217;m fully honest).<\/p>\n\n\n\n<!--more-->\n\n\n\n<h3 class=\"wp-block-heading\">ActivityPub plugin<\/h3>\n\n\n\n<p>It was super easy to set up, and seemed to have worked well: take my <a href=\"https:\/\/gergely.imreh.net\/blog\/author\/gergely\/\">author URL<\/a>, put it your Mastodon instance&#8217;s search, and voila, there&#8217;s a compatible profile which one can follow and interact with (to an extent, but still):<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub_profile_mastodon.png\" alt=\"Screenshot of the profle of this author page when searched on a Mastodon web instance, showing profile picture, about text, some links, post counts an Fediverse followers count.\" class=\"wp-image-2764\"\/><figcaption class=\"wp-element-caption\">How does my author profile look when searched on a Mastodon instance, this time on <a href=\"https:\/\/fosstodon.org\/\">Fosstodon<\/a>. One can use either the author URL or the shortened address shown under the profile picture to find a person.<\/figcaption><\/figure>\n\n\n\n<p>It all seemed to have worked, but coming back after a while, but <a href=\"https:\/\/wordpress.org\/documentation\/article\/site-health-screen\/\">Site Health<\/a> popped up a critical issue. \ud83d\ude40 <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"823\" height=\"261\" src=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-critical-site-health.png\" alt=\"Critical problem showin in the WordPress Site Health page, ighlighting that the author endpoint returns something unexpected.\" class=\"wp-image-2765\" srcset=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-critical-site-health.png 823w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-critical-site-health-500x159.png 500w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-critical-site-health-768x244.png 768w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><figcaption class=\"wp-element-caption\">Critical problem showin in the WordPress Site Health page.<\/figcaption><\/figure>\n\n\n\n<p>Digging in into what the endpoint actually returned when setting what response format the client want to accept:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">curl --silent -H \"Accept: application\/activity+json\" https:\/\/gergely.imreh.net\/blog\/author\/gergely\/<\/code><\/pre>\n\n\n\n<p>I can see that it indeed doesn&#8217;t look like a <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/JavaScript\/Objects\/JSON\">JSON<\/a> file, instead the cached web content:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"882\" height=\"589\" src=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-bad-cache.png\" alt=\"Terminal view of of the response to request to the JSON author page, showing cached HTML instead.\" class=\"wp-image-2767\" srcset=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-bad-cache.png 882w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-bad-cache-500x334.png 500w, https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-bad-cache-768x513.png 768w\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" \/><figcaption class=\"wp-element-caption\">Terminal view of of the response to request to the JSON author page, showing cached HTML instead.<\/figcaption><\/figure>\n\n\n\n<p>Hot on your trail, <a href=\"https:\/\/wordpress.org\/plugins\/w3-total-cache\/\">W3 Total Cache<\/a> (W3TC)! I use this plugin to make this site (hopefully) more performant, but it&#8217;s not looking great in this instance. Fortunately I got some interesting pointers by <a href=\"https:\/\/fosstodon.org\/@imrehg\/109843852024278070\">asking none other the Fediverse<\/a> about this issue, and got some helpful pointers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">W3 Total Cache<\/h3>\n\n\n\n<p>The way I understood how the W3TC plugin and my configuration worked was the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The plugin does some internal caching (opcode, objects,&#8230;) using  PHP, and something I don&#8217;t worry about much.<\/li>\n\n\n\n<li>The main performance benefit is coming from generating page caches on disk that can be loaded quicker then regenerating the page.<\/li>\n\n\n\n<li>Routing to those cached files is mostly through my <a href=\"https:\/\/nginx.org\/en\/\">nginx<\/a> web server&#8217;s configuration: the caching plugin creates an nginx configuration file with the relevant logic and redirects, so on the &#8220;happy path&#8221;  when the target page is cached, the request doesn&#8217;t even touch WordPress&#8217; backend at all.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Disabling Caching for an Endpoint<\/h4>\n\n\n\n<p>Based on the above (especially point 2), my train of thought started at &#8220;Can I tell W3TC not to cache that author endpoint if a specific header is received?&#8221; Looking at the <a href=\"https:\/\/github.com\/BoldGrid\/w3-total-cache\/wiki\/FAQ%3A-Developers#how-can-i-prevent-caching-directly-in-my-templates-etc\">W3TC FAQs<\/a>, there&#8217;s indeed a way to signal that, by disabling e.g. page caching when the plugin (ActivityPub in this case), by setting this inside the code path of the relevant page:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">define('DONOTCACHEPAGE', true);<\/code><\/pre>\n\n\n\n<p>Looking at <a href=\"https:\/\/github.com\/pfefferle\/wordpress-activitypub\">the source code of the ActivityPub plugin<\/a>, I could find <a href=\"https:\/\/github.com\/pfefferle\/wordpress-activitypub\/blob\/971c6ae5d52a9158678105b021637b414e08286f\/includes\/class-activitypub.php#L46\">where in the data flow<\/a> one would set this, before the author template is returned. I tried it out and seemed to have worked. I&#8217;ve even opened a <a href=\"https:\/\/github.com\/pfefferle\/wordpress-activitypub\/issues\/275\">GitHub issue<\/a> so that hopefully a fix can be developed for everyone!<\/p>\n\n\n\n<p>Looking further in the code (to do that fix), though, it&#8217;s not only the &#8220;author&#8221; page, but silently also all the posts and the front page has the same issue (of getting cached HTML when asking for JSON). \ud83d\ude40 If one disables caching on author + blogposts + frontpage, what else of note is left cached? Nothing really. And the plugin owner <a href=\"https:\/\/github.com\/pfefferle\/wordpress-activitypub\/issues\/275#issuecomment-1426763972\">agrees<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Route Request Based on Headers<\/h4>\n\n\n\n<p>Let&#8217;s try instead routing the request based on headers: if a compatible &#8220;Accept&#8221; header is received, bypass the cache, and use what he endpoint returns. Here comes the issue about the 3rd point above: the nginx configuration and its use.<\/p>\n\n\n\n<p>Ideally I would be able to add to the config a tests for this header, a check, roughly along the lines of this in nginx config::<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">if ( $http_accept = 'application\/activity+json' ) {\n # switch vars not to cache\n}<\/code><\/pre>\n\n\n\n<p>Following the <a href=\"https:\/\/github.com\/BoldGrid\/w3-total-cache\/wiki\/FAQ%3A-Installation%3A-Nginx-Web-Server\">installation steps<\/a>, when Page Caching is enabled in W3TC <a href=\"https:\/\/github.com\/BoldGrid\/w3-total-cache\/blob\/c0680d6f7ce7cee56a27eac6f9625ffd86f91510\/PgCache_Environment.php#L771-L777\">generates<\/a> an extra <code>nginx.conf<\/code> file that governs what happens. There are a lot of various checks (e.g. do not cache on <code>POST<\/code> requests, do not rewrite paths if the predicted cache file location is empty&#8230;.) I&#8217;ve been following the generated file, and tried to adjust the caching behaviour. To debug, I turned to <a href=\"https:\/\/nginx.org\/en\/docs\/http\/ngx_http_headers_module.html\">adding various headers<\/a> to the response, as it was easier than messing with the nginx logging rules. For example adding this just before the last rewrite rule kicks in would show the variable&#8217;s value that would decide if a rewrite happens:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">add_header X-gergely-debug \"rewrite-$w3tr_rewrite\";<\/code><\/pre>\n\n\n\n<p>Looking at this, in every situation I was getting &#8220;no rewrite to do&#8221; outcomes, and it wasn&#8217;t in the end too much a surprise, as the logic in that file seems to be flawed: generating on disk file locations from the request incorrectly and thus never finding anything (and\/or some of my misconfiguration? But there are definitely things which look plain wrong).<\/p>\n\n\n\n<p>But while the nginx rules shrugged, in the same time my web requests were returning the files from disk! If I rewrote the generated files, I got the modified version back. Then, frustrated, even emptied out <code>nginx.conf<\/code> to try to &#8220;break&#8221; caching &#8211; and it continued to work! \ud83d\ude43<\/p>\n\n\n\n<p>So I guess the actual behaviour was different from the above 3. point, and rather:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>W3TC generates <strong>nginx rules<\/strong> and hope that they work and take load off the WordPress backend<\/li>\n\n\n\n<li>If that doesn&#8217;t fly, <strong>generate the caches internally<\/strong> in the plugin (of course, have to be able to do that on first requests\/preloading anyways)<\/li>\n\n\n\n<li>The plugin still checks internally (in code) <strong>whether the cached file exists<\/strong> where it expects one on the disk and loads that, bypassing this above point!<\/li>\n<\/ul>\n\n\n\n<p>I haven&#8217;t verified this yet by looking at <a href=\"https:\/\/github.com\/BoldGrid\/w3-total-cache\/\">the code<\/a>, but this explains all the  behaviour I&#8217;ve seen while trying things (serving files that I&#8217;ve manually changed and working while having an empty nginx rewrite).<\/p>\n\n\n\n<p>So after all, these checks for the Accept header would need to be both in the nginx config (less important for me as it was already broken), and also in the code of W3TC (which feels currently less tractable).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Current and Future Fixes<\/h3>\n\n\n\n<p>What I&#8217;ve ended up with is the simple and dumb way for now: <strong>disable Page Caching altogether<\/strong>.<\/p>\n\n\n\n<p>For my site and level of traffic that should definitely not be a serious issue, though <a href=\"https:\/\/gtmetrix.com\/reports\/gergely.imreh.net\/OSRtS8nP\/\">I did check with a site speed test<\/a> just in case, and I don&#8217;t see much difference for my otherwise semi-broken setup.<\/p>\n\n\n\n<p>Still, it&#8217;s definitely a step forward not assuming &amp; hoping things are working (ie. nginx-based chaching) when they are not.<\/p>\n\n\n\n<p>What would be good for the future, though, is a pattern where cache plugins only <strong>cache what they can and if not pass it on to the rest of the processing<\/strong> (ie. check if the client &#8220;Accept&#8221; header is empty or defaults to <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Content_negotiation\/List_of_default_Accept_values\">some browser-y value<\/a>). I bet this is a naive view, and there are more complications. There likely should be more complications if WordPress is more of a &#8220;platform&#8221;, given then it will have to support a lot more different use cases and behaviours.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Future Rabbitholes <\/h2>\n\n\n\n<p>I&#8217;m definitely not alone in this quest, there are others who hit various ActivityPub + caching issues (e.g. <a href=\"https:\/\/jasontucker.blog\/14308\/whats-with-activitypub-wordpress-cloudflare-not-working\">using CloudFlare CDN<\/a>). With More Mastodon usage there might be some more satisfying solutions than &#8220;disable most caching&#8221;.<\/p>\n\n\n\n<p>I&#8217;ve definite learned more about WordPress Plugin internals by looking at the <a href=\"https:\/\/github.com\/pfefferle\/wordpress-activitypub\">ActivityPub plugin&#8217;s repo<\/a>. I&#8217;m sure I could pick up some stuff for the <a href=\"https:\/\/gergely.imreh.net\/blog\/2022\/07\/100-days-to-offload-wordpress-plugin\/\">100 Days to Offload plugin<\/a> in the future.<\/p>\n\n\n\n<p>During debugging I was also looking at my web server logs which I haven&#8217;t done for years, but I know would be a &#8220;proper&#8221; sysadmin thing to do. There were a lot of interesting queries that I want to follow up on (bots, sites, tools scaraping the blog and interacting with various bits). It&#8217;s the <em>Inter<\/em>net, after all, so let&#8217;s look at the connections made!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using WordPress blog as a Fediverse node comes with issues when site caching breaks my assumptions.<\/p>\n","protected":false},"author":1,"featured_media":2775,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[233,234,236,221],"class_list":["post-2762","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-admin","tag-activitypub","tag-mastodon","tag-w3tc","tag-wordpress-plugin"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>When WordPress caching is not what it seems - ClickedyClick<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"When WordPress caching is not what it seems - ClickedyClick\" \/>\n<meta property=\"og:description\" content=\"Using WordPress blog as a Fediverse node comes with issues when site caching breaks my assumptions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/\" \/>\n<meta property=\"og:site_name\" content=\"ClickedyClick\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/gergely.imreh\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/gergely.imreh\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-12T04:20:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-12T10:49:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-json-response.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1309\" \/>\n\t<meta property=\"og:image:height\" content=\"421\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Gergely Imreh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@imrehg\" \/>\n<meta name=\"twitter:site\" content=\"@imrehg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gergely Imreh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/\"},\"author\":{\"name\":\"Gergely Imreh\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\"},\"headline\":\"When WordPress caching is not what it seems\",\"datePublished\":\"2023-02-12T04:20:21+00:00\",\"dateModified\":\"2023-02-12T10:49:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/\"},\"wordCount\":1418,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\"},\"image\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/activitypub-json-response.png\",\"keywords\":[\"ActivityPub\",\"Mastodon\",\"W3TC\",\"wordpress plugin\"],\"articleSection\":[\"Admin\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/\",\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/\",\"name\":\"When WordPress caching is not what it seems - ClickedyClick\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/activitypub-json-response.png\",\"datePublished\":\"2023-02-12T04:20:21+00:00\",\"dateModified\":\"2023-02-12T10:49:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/activitypub-json-response.png\",\"contentUrl\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/activitypub-json-response.png\",\"width\":1309,\"height\":421,\"caption\":\"Screenshot of the author info from the ActivityPub JSON endpoint\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/2023\\\/02\\\/when-wordpress-caching-is-not-what-it-seems\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"When WordPress caching is not what it seems\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/\",\"name\":\"ClickedyClick\",\"description\":\"Life in real, complex and digital.\",\"publisher\":{\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/#\\\/schema\\\/person\\\/42391e2ae52c8ed76b37be509a5707b0\",\"name\":\"Gergely Imreh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\",\"caption\":\"Gergely Imreh\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g\"},\"description\":\"Physicist, hacker. Enjoys avant-guarde literature probably a bit too much. Open source advocate and contributor, both for software and hardware. Follow these posts on the Fediverse by @gergely@gergely.imreh.net\",\"sameAs\":[\"https:\\\/\\\/gergely.imreh.net\\\/\",\"https:\\\/\\\/www.facebook.com\\\/gergely.imreh\",\"https:\\\/\\\/www.instagram.com\\\/imrehg\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/gergelyimreh\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@GergelyImreh\"],\"url\":\"https:\\\/\\\/gergely.imreh.net\\\/blog\\\/author\\\/gergely\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"When WordPress caching is not what it seems - ClickedyClick","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/","og_locale":"en_GB","og_type":"article","og_title":"When WordPress caching is not what it seems - ClickedyClick","og_description":"Using WordPress blog as a Fediverse node comes with issues when site caching breaks my assumptions.","og_url":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/","og_site_name":"ClickedyClick","article_publisher":"https:\/\/www.facebook.com\/gergely.imreh","article_author":"https:\/\/www.facebook.com\/gergely.imreh","article_published_time":"2023-02-12T04:20:21+00:00","article_modified_time":"2023-02-12T10:49:51+00:00","og_image":[{"width":1309,"height":421,"url":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-json-response.png","type":"image\/png"}],"author":"Gergely Imreh","twitter_card":"summary_large_image","twitter_creator":"@imrehg","twitter_site":"@imrehg","twitter_misc":{"Written by":"Gergely Imreh","Estimated reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#article","isPartOf":{"@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/"},"author":{"name":"Gergely Imreh","@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0"},"headline":"When WordPress caching is not what it seems","datePublished":"2023-02-12T04:20:21+00:00","dateModified":"2023-02-12T10:49:51+00:00","mainEntityOfPage":{"@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/"},"wordCount":1418,"commentCount":0,"publisher":{"@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0"},"image":{"@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#primaryimage"},"thumbnailUrl":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-json-response.png","keywords":["ActivityPub","Mastodon","W3TC","wordpress plugin"],"articleSection":["Admin"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/","url":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/","name":"When WordPress caching is not what it seems - ClickedyClick","isPartOf":{"@id":"https:\/\/gergely.imreh.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#primaryimage"},"image":{"@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#primaryimage"},"thumbnailUrl":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-json-response.png","datePublished":"2023-02-12T04:20:21+00:00","dateModified":"2023-02-12T10:49:51+00:00","breadcrumb":{"@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#primaryimage","url":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-json-response.png","contentUrl":"https:\/\/gergely.imreh.net\/blog\/wp-content\/uploads\/2023\/02\/activitypub-json-response.png","width":1309,"height":421,"caption":"Screenshot of the author info from the ActivityPub JSON endpoint"},{"@type":"BreadcrumbList","@id":"https:\/\/gergely.imreh.net\/blog\/2023\/02\/when-wordpress-caching-is-not-what-it-seems\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gergely.imreh.net\/blog\/"},{"@type":"ListItem","position":2,"name":"When WordPress caching is not what it seems"}]},{"@type":"WebSite","@id":"https:\/\/gergely.imreh.net\/blog\/#website","url":"https:\/\/gergely.imreh.net\/blog\/","name":"ClickedyClick","description":"Life in real, complex and digital.","publisher":{"@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gergely.imreh.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/gergely.imreh.net\/blog\/#\/schema\/person\/42391e2ae52c8ed76b37be509a5707b0","name":"Gergely Imreh","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g","caption":"Gergely Imreh"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/1d5be311c5d616a3f4c7dfbc6b736ec817d2508b8c420ec29edb950d33fb4946?s=96&d=retro&r=g"},"description":"Physicist, hacker. Enjoys avant-guarde literature probably a bit too much. Open source advocate and contributor, both for software and hardware. Follow these posts on the Fediverse by @gergely@gergely.imreh.net","sameAs":["https:\/\/gergely.imreh.net\/","https:\/\/www.facebook.com\/gergely.imreh","https:\/\/www.instagram.com\/imrehg\/","https:\/\/www.linkedin.com\/in\/gergelyimreh\/","https:\/\/www.youtube.com\/@GergelyImreh"],"url":"https:\/\/gergely.imreh.net\/blog\/author\/gergely\/"}]}},"_links":{"self":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts\/2762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/comments?post=2762"}],"version-history":[{"count":12,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts\/2762\/revisions"}],"predecessor-version":[{"id":2781,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/posts\/2762\/revisions\/2781"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/media\/2775"}],"wp:attachment":[{"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/media?parent=2762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/categories?post=2762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gergely.imreh.net\/blog\/wp-json\/wp\/v2\/tags?post=2762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}