Parent5446 / web-bash

A functional terminal in your browser
GNU General Public License v3.0
5 stars 0 forks source link

chmod does not update the local file permissions #70

Closed krzysztofjordan closed 11 years ago

krzysztofjordan commented 11 years ago

*\ by this i mean that it does not update the cache

Parent5446 commented 11 years ago

Just for the record, the reason this occurs is because the cache operates using the Last-Modified and If-Last-Modified headers in HTTP. The server tells the browser when the resource was last modified, and on the next request, the browser says to only send it if it has been modified since. If not, the server replies with 304 and the browser uses cached data.

In this case, changing permissions with chmod will not change the Last-Modified time, because right now Last-Modified is only based on the file's mtime. In *nix, changes in permissions do not update mtime; they only update ctime, thus causing the caching issue.

The solution to this would be to make sure the Last-Modified header represents the latest of whatever the mtime and ctime is, rather than just mtime.