Skip to content

Caching headers are missing #360

@8ctopus

Description

@8ctopus

Cache enabler supports sending an HTTP response 304 with an empty body:

if ( strtotime( self::$request_headers['If-Modified-Since'] >= filemtime( $cache_file ) ) ) {
header( self::sanitize_server_input( $_SERVER['SERVER_PROTOCOL'] ) . ' 304 Not Modified', true, 304 );
exit; // Deliver empty body.
}

However the header for this to work is never sent: Last-Modified: Tue, 09 Dec 2025 08:02:34 GMT.

Explanation: When wordpress generates a webpage, it should provide the Last-Modified header, in order for the browser to provide this header on a refresh request. If the header is not present, then the 304 response can never be provided.

Update: Also Cache-Control or Expires is needed for the browser to know when to do a conditional request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions