Skip to content

Commit

Permalink
Merge pull request #52 from nox7/implement-static-vary-header
Browse files Browse the repository at this point in the history
Implement static vary header
  • Loading branch information
nox7 committed Aug 16, 2023
2 parents cf0f88a + 37073aa commit 33c005b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Nox.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Nox{
public function __construct(){
if (php_sapi_name() !== "cli") {
$urlPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

if ($urlPath !== null){
$requestPath = urldecode($urlPath);
}else{
Expand Down
1 change: 1 addition & 0 deletions src/Router/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function processRequestAsStaticFile(): void{
if ($cacheTime !== null) {

header(sprintf("cache-control: max-age=%d", $cacheTime));
header("Vary: If-None-Match, etag, last-modified, cache-control");

$lastModifiedTime = filemtime($staticFilePath);
if ($lastModifiedTime !== false){
Expand Down

0 comments on commit 33c005b

Please sign in to comment.