Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/avoid serving expired file #562

Merged

Conversation

viniciusbarros
Copy link

@viniciusbarros viniciusbarros commented Jun 11, 2018

I noticed this issue when the cache is served directly from the file. So all I added was a check to compare the file creation time + $cache_max_time against current time.

If expired, we return false and new cache is generated.

Notes:

  • I came across this issue when storing cache files in a custom directory. E.g: /tmp/wp-super-cache
  • I tested it locally and it worked as expected.

@donnchawp
Copy link
Contributor

Thanks. Good catch. I fixed some problems with space characters in your code.

@donnchawp donnchawp merged commit bba2622 into Automattic:master Jun 15, 2018
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