Questions tagged [cache]

A cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere.

Filter by
Sorted by
Tagged with
1
vote
3answers
276 views

Mobile Featured Image Bug

I have a weird issue on my site that's only affecting mobile. If you scroll down past the black "What's Hot" section, you'll see the standard posts with featured images. Now, if you refresh the page, ...
1
vote
0answers
13 views

Static page determines as home, but it is not

I've registered post type with slug services, which means that all content will be under example.com/services. Than I decided to remove it, so I deleted this code from functions.php. Now when I ...
0
votes
0answers
296 views

Can I do fragment caching with NGINX fastcgi?

I have an NGINX fastcgi cache setup on a site, it works really well. But now I would need to get the user's geographical location from NGINX to PHP, and do some redirecting based on that. I was ...
0
votes
1answer
80 views

w3 total cache uninstall remove cache

I'm experiencing a hug problem on a wordpress website. I have to migrate this website to new hosting provider; actually old developer used to install 'n setup w3 total cache plugin that I'd like to ...
24
votes
1answer
1k views

Is this Solution for Caches vs Cookies Going to Get Me in Trouble?

I've come up with a provisional solution for a not exactly common, but far from unprecedented problem with the interaction of popular WP caching solutions with cookies, in this case the standard WP ...
0
votes
2answers
240 views

_prime_post_caches in wordpress

It seems that wordpress will cache all the data including the meta values of all the posts in the current page by _prime_post_caches: As shown, it tried to fetch information for posts id within (76-...
0
votes
1answer
95 views

Fatal Error cannot log into wordpress and website disappeared

Hi i got a message to download another cache plugin but got another message saying the one i downloaded was not compatible with another plugin. i tried to deactivate the plugin but it then threw me ...
1
vote
1answer
2k views

Is there a get_post(s) filter that can alter/replace the output completely?

I would like to create a plugin that creates a JSON cache of saved/updated data. But for the plugin to be general purpose I'd need it to override the output of get_posts and other get_functions. I ...
0
votes
2answers
85 views

FATAL ERROR - white page - no site showing

This is the message that I got shortly after I clicked on the option to upgrade to the newest version of Wordpress. I made the mistake of NOT backing up my files somewhere and now I am wondering if I ...
0
votes
1answer
101 views

Object Caching Plugin force every plugin to cache objects?

Can caching plugins (like w3 Total Cache or similar) force themes and plugins to use cache for every object instantiated? Or are they just optimizing plain WordPress.
1
vote
2answers
735 views

To have Wordpress interact with memcached it must be installed as a PHP extension?

I have the Memcached Daemon running on my server but some plugins for wordpress don't see it (i.e. W3 total Cache). Do I need to configure it as a PHP extension to use it? I've found this answer: W3 ...
2
votes
1answer
17k views

Getting “Fatal error: Call to undefined function wp_cache_get() in option.php” after updating a cache plugin [closed]

I updated "W3 Total Cache Plugin" and later the error below appeared: Fatal error: Call to undefined function wp_cache_get() in /home/example/public_html/wp-includes/option.php on line 1117 Any ...
1
vote
1answer
22 views

Method to make definitively static an abandoned WP blog

I have a blog, created with WordPress 3.4, which I abandoned some years ago but it is still receiving a good number of visits each day through Google search results. It means a load for my mySQL ...
2
votes
1answer
16k views

How to clear Wordpress Cache from Server/FTP/Remote location

I don't normally work in wordpress, having hard time finding a lot of things. I added one line of custom php to a template file in child theme, and i forgot a semi colon. Now the site will not load ...
2
votes
0answers
1k views

Database Cache and Object Cache Difference?

I am a bit confused here. Is there a difference between object and database caching ? I am planning to only do object caching for my site. Does object caching include database caching ?
1
vote
1answer
1k views

Maximum lifetime for nonce

In our project we allow users to buy a coupon ( WooCommerce product ) for some service. We save every coupon as a custom post type with all the customer data inserted during purchase. We then via ...
2
votes
1answer
395 views

Register script version not showing

I want to implement cache busting on a specific script, but the version is not added to the url as query vars. Here is the code I'm using : wp_register_script( 'custom', ...
2
votes
1answer
648 views

How to prevent queried posts from being added to cache?

I'm learning about caching parameters and tried this in the single.php template: echo count($wp_object_cache->cache['posts']); $query = new \WP_Query([ 'post_type' => 'post', '...
6
votes
1answer
2k views

Using get_posts vs. WP_Query

I'm running the following PHP Code Sniffs on some WordPress code, and the following warning pops up 352 | WARNING | get_posts is discouraged in favor of creating a new | | WP_Query() so ...
1
vote
1answer
38 views

I am getting useless alphabets in images link

I dont know why i am getting extra alphabets and question mark in my image links. Please take a look Can any one tell me how I can fix this issue.
2
votes
0answers
1k views

How to remove duplicate query on page load or make them cacheable

I'm having the same issue as Lletnek where there are the same duplicate queries for get_page_by_path on some of the pages on our website. I have got the queries down to 2/3 on most pages using ...
1
vote
1answer
3k views

How to store or cache custom shopping cart data for every user's session

I'm developing a shopping cart and I don't want to use any plugins as none of them can serve my needs. So I'm heading to create my own shopping cart. My question is: How to store what the user added ...
1
vote
0answers
351 views

Running code before object-cache.php runs

I want to polyfill some functions before object-cache.php runs. I have PHP7 and APCu installed. However, W3 Total Cache is using apc_* functions, not apcu_* functions. W3 Total Cache's object cache ...
1
vote
1answer
495 views

Enabling compression in .htaccess file is causing 500 internal error

This is the code I am adding to my .htaccess file for compression and browser caching and gzip. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^...
1
vote
1answer
18 views

cache specific data?

I want to display some information from database in each post, for example date of registration of user and user role etc. It is quite static data that doesn't change. Now if I make a query to the ...
1
vote
2answers
113 views

Clearing caches on plugin uninstall

When a plugin is uninstalled, it should remove all related data from the site (or network, if on multisite). If a plugin adds tables to the database, for example, it should remove those tables from ...
1
vote
0answers
38 views

Server stressed by /feed

I'm debugging a website that my friend has hosted on a VPS that should be perfectly capable of handling a Wordpress installation that gets ~2m monthly visitors. During the last few months, his uptime ...
1
vote
0answers
1k views

W3 Total Cache: use cache for request with ignorable query string [closed]

Currently W3 Total Cache use cached page only if query string is empty, the rule is: RewriteCond %{QUERY_STRING} ="" in this code (from .htaccess): # BEGIN W3TC Page Cache core <IfModule ...
8
votes
4answers
2k views

Is it possible to completely stop WP_Query retrieving posts?

I'm trying to use WP Redis to cache entire $wp_query object with key is $query_vars_hash. This is how $wp_query was added to $wp_object_cache: add_action('wp', function($wp) { if ( is_admin() ) ...
0
votes
1answer
55 views

How to keep cache files after plugin update?

I've got a premium plugin and setting up a custom solution to serve updates. However I've got a question regarding how contents are managed. Wordpress just remove old plugin folder and install the ...
-2
votes
3answers
197 views

To what degree can use of caching-plugins and a CDN boost WordPress performance? [closed]

I realize that this question is being asked in a very generic fashion, without detailed specifics of the configuration in question, and thus I am not expecting answers that go beyond anything but ...
0
votes
1answer
209 views

Popular posts with Varnish ESI

I am trying to get Varnish ESI to work with displaying the most viewed posts on a new blog I am working on. Here is my current script; In theme file: <esi:remove> <?php get_template_part( '...
0
votes
1answer
18 views

Cloud flare, cache, minify question [closed]

If I am using Cloud Flare to serve my site, and use their Cache and minify options, is there sense in caching and minifying at the Wordpress level as well? Is this a waste of time or do I get a ...
0
votes
2answers
35 views

Local PC cache stays filled with old WordPress Site data

I am developing a new WP site. My client complains that he see old site data like links that refer to old category names. On my PC and other I have no problems with this. On server side there is no ...
2
votes
1answer
754 views

Usage of Direct Database Call Without Caching Error

I have a custom function that creates a dynamic copyright year range based on the year of the first and last posts in the database: function jldc_copyright_dates() { global $wpdb; $...
0
votes
1answer
2k views

How can I cache font files on Wordpress [closed]

The caching portion of all of the speed tests fail on my site because I am using font files to pull in my fonts. I am using w3 Total Cache, and KeyCDN. The font files are hosted in a folder inside ...
0
votes
1answer
209 views

opcache_reset on plugin/theme/core update

wordpress it seem not reset opcache after plug-in/theme/core update. For solve this issue i have set in the php.ini opcache.validate_timestamps=1 all work correctly but validate_timestamps when it'...
1
vote
1answer
614 views

Transients are not expiring as expected in simple custom plugin

I have developed a simple shortcode plugin that essentially gets txt files from the url provided in the shortcode and parses a specific piece of data from them (date the file was last modified). I am ...
6
votes
1answer
4k views

Nginx FastCGI_Cache Vs PHP Caching

I have been doing some experimenting with caching performance using loader.io and have been left with some puzzling results. I was originally on a shared host that used a LAMP stack. Even with ...
0
votes
2answers
245 views

get_theme_mod returning cached values regardless of apache restart

get_theme_mod is returning cached content: this code: $parallax_one_logos = get_theme_mod('parallax_one_logos_content', json_encode( array( array("image_url" => ...
9
votes
1answer
10k views

Is define('WP_CACHE', true) needed for object caching?

I am just reading the docs at https://codex.wordpress.org/Class_Reference/WP_Object_Cache and am not clear on something... If I install an object cache plugin by adding the drop-in file object-cache....
0
votes
2answers
692 views

Files cached as CSS or PHP?

I'm using a dynamic CSS file with PHP extention. wp_enqueue_style('css', get_template_directory_uri().'/inc/css.php'); The output: <link rel='stylesheet' id='dynamic-css' href='PATH/inc/css.php?...
0
votes
0answers
84 views

Can't change javascript files

I've deleted a javascript file from my server, but it appears to still be there when making requests to the web server. I made a GET request with cUrl to the specific .js file to make sure there wasn'...
1
vote
2answers
826 views

Is using WP Transients to save external data for a plugin the best/right way?

I am developing a plugin which relies on external data to be fetched from time to time. To speed things up, I´d like to cache the received data and refresh it in intervals of 10 or 15 minutes. This ...
0
votes
1answer
322 views

Add Hook for clearing transient when post is added

I have fragment caching implemented in a page. I've got the codes from https://css-tricks.com/wordpress-fragment-caching-revisited/. Which goes like this: function fragment_cache($key, $ttl, $...
2
votes
1answer
256 views

Difference between fragment caching and wp_cache

I've been really confused about these two caching modes. What's the main difference between fragment caching and wp_cache? Can both of them be used hand in hand? EDIT I've read about the fragment ...
0
votes
1answer
553 views

Improving wpdb queries with large data

My plugin will handle large amounts of data that could could result in the queries reading over 5000 items in a database query. The admin will provide a set of CSV files that get stored/organized in ...
0
votes
1answer
247 views

How to let users clear their posts cache with WP Super Cache?

Right now with WP Super Cache, when an admin updates a post, the cache is cleared and new cached version is generated. How do I let users do the same with own posts? (When they update their posts the ...
0
votes
1answer
1k views

wordpress images not showing properly

Images are not visible properly in the media library after caching them from my other website. The featured image is also not being set. However the images are showing up on the front end of the ...
27
votes
2answers
6k views

Explanation of update_post_(meta/term)_cache

I was reading over some best practices from 10up and they mention setting these two flags to false in a WP_Query ( depending on what you're querying ): 'update_post_meta_cache' => false: useful ...

1
3 4
5
6 7
12