Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

LoadFromFileCacheTtlMs is not honored (*after* first request) #1418

@0x42h

Description

@0x42h

When LoadFromFile is set with a custom LoadFromFileCacheTtlMs, the first request wil honor the LoadFromFileCacheTtlMs, but after the first request, it wil default back to max-age: 300 (5 minutes), as per the non-public psol code.

Example:

inside the server config:

pagespeed LoadFromFile "http://example.com" "/var/www"
pagespeed LoadFromFileCacheTtlMs 31556926000;

First request

Request URL:
https://example.com/test.js?1

Response headers:

HTTP/1.1 200 OK
Server: nginx/1.10.0 (Ubuntu)
Content-Type: application/javascript
Transfer-Encoding: chunked
Connection: keep-alive
Date: Tue, 16 May 2017 17:31:57 GMT
Expires: Wed, 16 May 2018 23:20:43 GMT
Last-Modified: Tue, 17 Jan 2017 14:01:55 GMT
Cache-Control: max-age=31556926, s-maxage=10

Second request

Request URL:
https://example.com/test.js?1

Response headers:

Server: nginx/1.10.0 (Ubuntu)
Content-Type: application/javascript
Connection: keep-alive
X-Original-Content-Length: 32197
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 8806
ETag: W/"PSA-aj-CiswHsWsJj"
Date: Tue, 16 May 2017 17:32:53 GMT
Expires: Tue, 16 May 2017 17:37:53 GMT
Cache-Control: max-age=300

Third request

Request URL:
https://example.com/test.js?2

Response headers:

Server: nginx/1.10.0 (Ubuntu)
Content-Type: application/javascript
Transfer-Encoding: chunked
Connection: keep-alive
Date: Tue, 16 May 2017 17:34:15 GMT
Expires: Wed, 16 May 2018 23:23:01 GMT
Last-Modified: Tue, 17 Jan 2017 14:01:55 GMT
Cache-Control: max-age=31556926, s-maxage=10

Fourth request

Request URL:
https://example.com/test.js?2

Response headers:

Server: nginx/1.10.0 (Ubuntu)
Content-Type: application/javascript
Connection: keep-alive
X-Original-Content-Length: 32197
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 8806
ETag: W/"PSA-aj-CiswHsWsJj"
Date: Tue, 16 May 2017 17:35:03 GMT
Expires: Tue, 16 May 2017 17:40:03 GMT
Cache-Control: max-age=300

The even results are repeated for every request after this, with the exact same URL, maintaining the (PSOL/default) 300 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions