Code Monkey home page Code Monkey logo

Comments (3)

minbaby avatar minbaby commented on May 18, 2024

I think this bug is because of amphp/file.

StatCache cache the file state, but not update file state when file info changed.

$fileInfo->etag = \md5("{$fileInfo->path}{$fileInfo->mtime}{$fileInfo->size}{$inode}");

if (!$stat = yield $this->filesystem->stat($path)) {

https://github.com/amphp/file/blob/cc1d11993e1546e4cad9bd2de22c6ba8ff88af3c/lib/UvDriver.php#L115

https://github.com/amphp/file/blob/cc1d11993e1546e4cad9bd2de22c6ba8ff88af3c/lib/StatCache.php#L19

from http-server-static-content.

bwoebi avatar bwoebi commented on May 18, 2024

So, setting StatCache::ttl(0); in your server does fix it?

Generally the StatCache is a good thing, reducing latency by a good margin...
We possibly should add a file change watcher (i/anotify for example) for stat invalidation ...

from http-server-static-content.

minbaby avatar minbaby commented on May 18, 2024

Yeah, we need inotify extension. if has inotify, all the thing can bu resolved.

This is two reason,first is StatCache, another is cache too.
We can't get the file stat on file changed. if We have not inodify,only update file info in every seconds

private function fetchCachedStat(string $reqPath, Request $request) {

from http-server-static-content.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.