Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#49176 closed defect (bug) (invalid)

Wp-admin area / pages are cached WordPress Version 5.3.2

Reported by: techjockey's profile techjockey Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: Cc:

Description

this is similar issue like - #37889

wp-admin pages / area getting cached,whatever changes i make to the posts in my wp-admin e.g. changing the dates it does not reflect, new post always overriding older post, uses the same post ID

it looks like all my wp-admin pages are cached

I tried following changes as suggested by godaddy support, but still issue persists

  1. changes php version from 7.3 to 5.6 and then after sometime back to 7.3
  2. added define('WP_CACHE',false); in wp-config.php - https://in.godaddy.com/help/disable-wp-cache-for-wordpress-19513
  3. changed name-servers from clouflare to godaddy
  4. disabled all plugins
  5. checked with different browsers and networks

Change History (6)

#1 @fierevere
5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Please use support forums for your issue: https://wordpress.org/support/
This trac is for reporting core bugs. Your problem is most likely related to your hosting environment (i.e. server-side cache)
Asking hoster's support is advised too.

#2 @techjockey
5 years ago

I have worked with hosting provider, Godaddy they are not able to solve the issue. Thats the reason i turned up to wordpress team for help. I talked to atlease 5 people on godaddy support and nothing helped.

#3 follow-up: @fierevere
5 years ago

You still have to use support forums instead of trac.

By the way: define('WP_CACHE',false); - you should never use this. And it will not help in case /wp-admin/ pages are cached. Instead it makes your site much slower.
Your hoster might use LiteSpeed and/or mod_pagecache (or its alternative for respective webserver), often it is the issue of any page caching.

You should double-check your .htaccess file or other webserver rules, so they dont meddle with

Cache-control

header

you can try adding to your active theme functions.php this code:

function add_pragma_no_cache_header( $headers ) {
	$headers['Pragma'] = 'no-cache';
	return $headers;
}
add_filter( 'nocache_headers', 'add_pragma_no_cache_header' );

#4 in reply to: ↑ 3 @techjockey
5 years ago

Replying to fierevere:

Thank you fierevere, i will move to support forum for this. Just to reply... I have added the code to functions.php and removed following code from my .htaccess but it still does not resolve the issue.

# DISABLE CACHING
<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|png|pdf|swf|txt)$">

<IfModule mod_expires.c>

ExpiresActive Off

</IfModule>
<IfModule mod_headers.c>

FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"

</IfModule>

</FilesMatch>

Again, thank you for your guidance, i will seek help from our support community now.

#5 @desrosj
5 years ago

  • Component changed from General to Administration
  • Milestone Awaiting Review deleted

#6 @janvitos
5 years ago

Hi @techjockey,

I had the exact same issue that you described and found out today that CloudFlare was the culprit.

CloudFlare always cached PHP when using a Cache Everything Page Rule, but in the past, it had no effect on the WordPress admin pages as they always behaved properly like they weren't cached at all.

But it seems like CloudFlare changed something recently, and now the cached PHP pages were causing all kinds of weird issues with WordPress, like new posts overriding older posts, save / update buttons not saving or updating, new posts not appearing in the post list until you refreshed the page, etc.

I can tell you this problem was serious enough that I lost some articles and had to get my writers to rewrite entire articles because they had just vanished. I told my writers to start using Chrome with DevTools open and Disable Cache checked under Network, which temporarily solved the issue, but was not a long term solution.

The permanent solution for me was to add the following CloudFlare Page Rule:

www.website.com/*.php*

This prevents CloudFlare from caching all PHP files from your website, with and without query strings, and it should fix the issue for good. Make sure you clear the CloudFlare cache and the WordPress cache afterwards, and I would even clear your browser's cached images and files just to make sure.

To moderators: I know this is out of scope, but I saw many people around the web experiencing this same issue, so you could leave my comment here so people looking for answers to this problem might find the answer they're looking for.

I will also be posting this on the CloudFlare community forum.

Cheers.

Last edited 5 years ago by janvitos (previous) (diff)
Note: See TracTickets for help on using tickets.