[wp-trac] [WordPress Trac] #37889: "Add post" overwriting a previous post in 4.6
WordPress Trac
noreply at wordpress.org
Mon Apr 17 23:28:51 UTC 2017
#37889: "Add post" overwriting a previous post in 4.6
-------------------------------+-----------------------------
Reporter: tgelles | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Posts, Post Types | Version:
Severity: normal | Resolution: invalid
Keywords: | Focuses: administration
-------------------------------+-----------------------------
Comment (by SergeyBiryukov):
If you're experiencing this issue, try adding this to the active theme’s
`functions.php` file to see if it makes a difference:
{{{
function add_pragma_no_cache_header( $headers ) {
$headers['Pragma'] = 'no-cache';
return $headers;
}
add_filter( 'nocache_headers', 'add_pragma_no_cache_header' );
}}}
`Pragma` is a client request header that normally shouldn’t be present in
server response. In earlier WordPress versions it was added for
compatibility with older IE versions that didn’t understand `Cache-
Control`. In WordPress 4.6 it was removed as no longer necessary, see
[37944].
However, some environments might have weird or invalid cache control
headers, and restoring `Pragma` might help in that case. I’ve seen an
[https://habrahabr.ru/post/312696/ article on this issue] (in Russian),
although the author didn’t fully understand the change and fights the
symptom instead of the cause.
In a recent [https://wordpress.org/support/topic/wordpress-is-creating-
revisions-instead-of-new-posts/#post-9030853 support forums thread], these
Apache settings were the culprit:
{{{
<IfModule expires_module>
ExpiresActive On
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>
<IfModule headers_module>
<FilesMatch "\\.(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</FilesMatch>
Header unset ETag
Header unset Last-Modified
</IfModule>
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37889#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list