Skip to content

Add Cache-Control header to revcheck.php for improved caching - #70

Open
sy-records wants to merge 1 commit into
masterfrom
fix/cache
Open

Add Cache-Control header to revcheck.php for improved caching#70
sy-records wants to merge 1 commit into
masterfrom
fix/cache

Conversation

@sy-records

Copy link
Copy Markdown
Member

Caching can result in retrieving outdated information; I'm not sure if we should set different time values based on $tool.

https://doc.php.net/revcheck.php?p=files&lang=zh

@sy-records
sy-records requested a review from derickr August 26, 2026 06:36
Comment thread www/revcheck.php
}

site_header();
header('Cache-Control: public, max-age=3600');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a way how to do this through site_header in https://github.com/php/web-php/blob/master/include/layout.inc#L445 and https://github.com/php/web-php/blob/master/include/header.inc#L56 — and I think a similar approach should be taken here. It's going to be more consistent among sites. We could also set a different value for each of the .php files in this repository.

I also see that in www/revcheck.php there are some site_header() calls that really ought to cause a 404 or something else, as they're error situations. (Perhaps for a different PR though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants