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.
573
questions
0
votes
0answers
13 views
Mobile detect directive only works after first refresh [closed]
I am trying to detect mobile devices and send them to a different directory on my server. The desktop version of the website is a WordPress website; the mobile version is HTML. At the moment, the ...
0
votes
0answers
12 views
wp_register_script() and wp_register_style() 4th parameter (version) not working for logged out users
I'm enqueuing scripts and styles from functions.php in my custom theme. The 4th parameter is the version number. It's working only for logged in users.
wp_register_script( 'my-handle', ...
0
votes
1answer
18 views
CSS changes only show when signed out
I've seen many posts saying the CSS only shows updated when signed in - however, my issue is the opposite.
When signed out, the CSS is cached by SGOptimizer and is all minified. When signed in, the ...
0
votes
0answers
39 views
How to fix caching issue in PHP data from database
Im trying to use the code belong for my plugin development but there is a caching issue (I think). Please below for the details.
Problem
I created filter to accept the customized url, and I'm querying ...
0
votes
1answer
13 views
How to add support for caching plugins for my own plugin?
Is there a generic way to support caching plugins? For example to set a flag after you update an option that caching plugins watch?
For example WP Super Cache has this:
function wp_cache_clear_cache() ...
0
votes
0answers
14 views
When changing urls with elementor the url is correctly shown in the code, but when clicking it redirects to an old url
I recently tried to update the url of a column using elementor. All looks fine when I inspect the element, it shows the correct URL, but when I click the column it redirects to an old page that does ...
0
votes
0answers
17 views
JavaScript works for me but not for a co-worker
So, I'm having some trouble with my code. Everytime I refresh the website the code is working for me, but my co-worker has some slight visual bugs (parts of the site is not loading in, animations don'...
1
vote
1answer
624 views
How can I set Cache TTL for woff and woff2 font files with htaccess?
My WordPress site htaccess file currently has these entries to set cache expiry for woff and woff2 font files:
<IfModule mod_expires.c>
# Content type
AddType application/font-woff .woff
...
0
votes
0answers
6 views
When is a Plugin Class Contsructor fired on a WP site
I'm trying to build a cache for data captured by a plugin I am writing and I have some questions on when are plugin constructors fired when word press uses them?
I see three options:
When the plugin ...
0
votes
0answers
17 views
WordPress images & thumbnails not displaying (possibly caching)
I am having some problems with my websites displaying certain content, you can see for yourself at my site; https://uniqueteambuilding.com.au/. To summarise three errors occur;
The activity thumbnail ...
0
votes
0answers
61 views
WordPress Object Cache and ENABLE_CACHE
An article by Jeff Starr suggests that to benefit from WordPress' native caching capabilities, that define('ENABLE_CACHE', TRUE); should be included in the wp-config.php file. There also appear to be ...
0
votes
0answers
14 views
Will http caching using WP_REST_Response() be specific to the data that is requested?
If I have data being requested, and the response is dependent on the data requested, would the following sample code cache all responses the same, or would it somehow know "you requested a ...
0
votes
0answers
12 views
w3 total cache write a brokent url
I'm using w3 total cache, and I have a s3 bucket where I store all my files (wp-includes, wp-content/themes, wp-content/uploads), everything seems to work fine except for the themes directory
for ...
0
votes
0answers
17 views
Save large WP_Query to transient === false
I try to save a WP_Query to a transient but it's always comes back false dispite the fact that the transient is saved.
Here is the code:
$fitsToTransientName = 'g_wc_fits_to_' . get_the_ID();
$...
0
votes
1answer
66 views
Woocommerce - how to round up all prices to end in .99
I need to update all prices in my store to end in .99, both on the front end and in the database. I have the following code which appears to do it when I run a shortcode, but I have a problem.
When I ...
0
votes
0answers
26 views
Caching issue for the mini cart count
I have developed a woocommerce theme. I also use a caching plugins (Autoptimize + WP Fastest Cache).
On my header I have a cart icon which displays how much items are in the cart.
But this is not ...
3
votes
1answer
60 views
Stale cache handling with a persistent object cache
Lets say you are doing an update_option() and because of some temporary network glitches updating the value in Redis/Memcached fails and you end up with a stale cache for a specific option key. The ...
0
votes
0answers
18 views
Eliminate render-blocking resources- can w3 total cache be used with auto optimize?
when testing a site on page insights & gt metrix. js & css blocks the main content.
Will using w3 total cache & autoptimize toogether or in any case 2 caching plaugin with CDN will solve ...
0
votes
0answers
14 views
Using Cloudflare with W3 Total Cache on woocommerce website
I am using Cloudflare together with W3 total cache on my website and followed this tutorial to set it up https://www.mprstudio.com/speed-up-wordpress-w3-total-cache-cloudflare/ . Please let me know if ...
0
votes
0answers
26 views
Undefined cache functions in my custom plugin
I am making a plugin that make a HTTP call to my API, I want this call be cached an tried using this way:
static function get_info(){
$cache = wp_cache_get( $username, "action" );
if(...
0
votes
0answers
11 views
How extract wordpress in my wordpress cache folder
Hello I want to extract my WordPress in my cache folder I am using the swift performance plugin
Example of website:
https://www.centrobiozen.es/
What I want on my website:
https://www.centrobiozen.es/...
0
votes
0answers
13 views
Cost efficient way of pre-loading cache on server
So I've been struggling with my woocommerce site and its loading time since it has a lot of content the loading time is very slow for anyone to be interested in waiting for it to load.
I was told that ...
0
votes
0answers
14 views
Creating a cache but cant seem to find add_widget or edit_widget do_action
Creating a cache plugin when I edit/delete/add post etc, it will reset the cache but can't find add_widget or edit_widget. Does anyone have the answer? What other do_action am I missing here?
...
0
votes
2answers
95 views
WP 5.5, child themes, customizer and a weird cache issue
Update:
I created a fresh new installation of WordPress, copied both Base and Base Child themes and activated Base Child. The Appearance/Customize gives the same white screen as described in point 1 ...
0
votes
1answer
112 views
dynamic page not displaying correctly when Varnish hosting ignores query string parameters
I have a WP site with managed hosting that uses Varnish. I have a landing page that displays the appropriate images based on a couple arguments passed through the query string. So for example, ...
0
votes
2answers
32 views
When I save changes for css and js in my WP localhost env windows 10 the changes don't take effects immediately!
Hey guys I am developing a wp theme, and I am using for localhost server XAMPP and Wampserver.So anytime I save my changes specially for css and js it doesn't take effects immediately! sometimes it ...
0
votes
2answers
30 views
How to be sure to get last page version without ANY cache?
As developer, you want all the time the last version files on page refresh action.
As I understood, there are 3 kinds of cache :
Browser cache (Browser settings)
Website cache (WP plugins)
Proxy ...
0
votes
0answers
62 views
how to prevent post update time and DL count from caching Litespeed
in my site, I have some sections like post update time and DL count.
these sections must return real value.
for them, I used from ESI block by PHP code.
add below code in my function.php file:
...
0
votes
0answers
43 views
Is there a way to cache mailchimp css on wordpress?
At that point where I'm playing with load times and scores on Lighthouse, GtMetrix and the like, and am seeing problems? where external css scripts aren't being cached. For example, from mailchimp.com:...
0
votes
0answers
108 views
Pictures randomly replaced by blue question mark
My pictures are sometime replaced by blue question mark
On the devices that have already visited my website, some pictures are randomly replaced by blue question mark. (first time visitors usually donā...
0
votes
0answers
16 views
theme change doesn't show on mobile
I've uploaded a new version of the child theme, adding a -v2 onto the theme folder name.
However, my mobile is still viewing the non-v2 theme's stylesheet.
How do I force mobiles to respect the new ...
0
votes
1answer
138 views
Gravity forms / Recaptcha / Autoptimize - somewhere it goes wrong
I am using Gravity Forms and have recently started using their Google Captcha integration. (We also use Autoptimize )
The problem I have is that de captcha validation goes wrong, but I am not sure ...
0
votes
0answers
761 views
How do I disable cache for a certain page?
Wordpress beginner here with a probably easy problem, yet I don't know how to do it. I want to disable caching on certain pages of my site.
I best describe what I do:
I have written a plugin in php
...
0
votes
1answer
410 views
How to not cache nonces with WP Rocket?
We have a system where we pass a nonce from a PHP-script on the server to an AJAX-call running client-side, and then back again to check the validity of the request.
This nonce is cached, and we can'...
0
votes
0answers
15 views
Site speed slows when user logged in
my wp site is hosted on an IIS windows server. Issue is, my ttfb when a user is logged in is a lot longer (2/3 seconds) then when no user is logged in (super fast). See this video for a demo:
https://...
0
votes
1answer
135 views
Password Protected Pages Don't Accept A Valid Password After Changing The Password
I have a password protected page which I recently was asked by my client to change the password. The password protection is done from the WordPress dashboard by using the Status and visibility option ...
0
votes
0answers
32 views
Problem with cache, plugin Litespeed and server Litespeed
I have been using the wordpress Litespeed plugin on my site Trailer y Estrenos CO. I have the Chemicloud hosting and it uses the Litespeed server, which according to them, it works super well if is ...
0
votes
0answers
34 views
Google Page Speed
My website is in Wordpress so I am asking question regarding Google Page Speed here.
My issue is i had completed the development of home page of existing page now when i am trying to check the score ...
0
votes
1answer
58 views
Page not found if mod_cache_disk is active
I set in Apache the mod_cache_disk module, but I'm getting 404 page not found error on every page and posts. I'm using WordPress Multisite on Debian 10 server with PHP FPM 7.4.
I set this below in ...
0
votes
0answers
16 views
Changing cache update rate
Im using mylisting theme in wordpress. in listing ordering, one option is Random (cached and updated every few hours). How can I adjust the update rate from few hours to few minutes ? or even remove ...
0
votes
2answers
67 views
What do I do if my WordPress site is suddenly sanitizing portions of URLs it shouldn't?
Nobody has touched wp-admin for this site in weeks. Suddenly, URLs are being sanitized in ways that break everything. The question marks of query parameters are being replaced with URL escape code %3F,...
1
vote
1answer
26 views
Wordpress is not able to change themes
Wordpress Website has two themes, newspaper magazine and twenty twenty, it uses by default newspaper magazine, if I change to twenty twenty, the homepage remains using newspaper magazine, but if I go ...
0
votes
0answers
314 views
How to fix Autoptimize and Cloudflare interaction
Yesterday I was trying to change just one option of the WP Autoptimize plugin (inline and defer css) to avoid it render blocking. This was the process of it:
I extracted the critical CSS with an ...
0
votes
0answers
119 views
The editor has encountered an unexpected error. Shortcut key to duplicate Ctrl+Shift+D breaks gutenberg
whenever I try to use the shortcut key to duplicate Ctrl+Shift+D , wordpress gutenberg editor just errors out āThe editor has encountered an unexpected errorā
Please help, its very hard to write ...
0
votes
0answers
426 views
How to speed up post list slowed by update_meta_cache()?
Having run Query Monitor on my site, the post list for a custom post takes 18.17s. Query Monitor advises 2 Slow Queries, including...
SELECT term_id, meta_key, meta_value
FROM wpcxt_termmeta
WHERE ...
0
votes
1answer
25 views
Language does not switch while cache is enabled
At my website I have a button when pressed PHP script through ajax write session variable to change language and reload page. But when I enable caching every time is loading default language. When ...
0
votes
0answers
31 views
How to use cache for different language pages and handle multiple languages?
I have webpage with language change button. When I press the button I write into php Session variable parameter 'en' for english language. Then I reload whole page, but language is still same nothing ...
0
votes
0answers
25 views
Dark mode with cache plugins
I integrated dark mode switcher into my theme. It's logic of work is as follows:
I made a button with jquery, it toggles dark_mode cookie value 1 or 0
In my php:
if ( isset( $_COOKIE[ 'dark_mode' ] ...
1
vote
0answers
55 views
How can I cache the LearnDash quizzes on my server?
I'm using the WP LearnDash module for providing my courses. I see sudden horrible lags particularly when using the quizzes. Most of the time they load in a couple of seconds. However, sometimes it can ...
0
votes
1answer
31 views
Check the stored / cached WP_Query with transients on post change
right now I have WP_Query stored for 24h (1day) with set_transient function. Everything works fine like it should. But if for example I change the post which is in the stored array to private or ...