netmaster Imagine situation like that. User logs in, to look at the new files in certain folders. After going to some folder, there is same file listing what was yesterday.
If user logs in from the main login page, this will never happen. If the user "logs in" to check a dir, it will always load the latest version of the dir. But only if the dir changed since "yesterday", else it can just use the cache of course. Files Gallery automatically detects this.
netmaster There is no way to see, if there is no new files or are they just not visible. Then user must hit refresh to see, is there new files or not. And do this in every folder. Yes I have tested it.
No you have not tested this. What you have tested is just "navigating back and forth to a folder". As per your initial statement, "User logs in" from the login page, it will always reload dir if the dir has changed, else it will use the cache.
It will cache the current dir in javascript memory when Files Gallery is already loaded, but let's be very clear about definitions here. If the "User logs in" from login page and clicks any dir, the dir will always display updated content.
netmaster If I refresh it manually, then of course it get updated. I suggest an option, that in very dynamic sites, folders get refreshed automatically every time when entered.
With "every time when entered", I guess you mean when first navigating away from the folder, and then navigating back again? This can be achieved with Javascript config options:
_c.config = {
// folders are stored in javascript cache / if disabled, folders will always reload from server on navigation
javascript_cache: false,
// folders are stored in browser localStorage cache when re-visiting the application
localStorage_cache: false,
}
Keep in mind, with the above changes, it could still use server cache, but in this case it will first check if the cache is valid. If yes, then it serves the cache, else it will re-generate the page data. When the above are set to true
(default), folders will get cached in the application without re-checking on server when navigating between pages ... This is beneficial for most users, because navigation is instantaneous instant between folders that don't change often.
netmaster how will browser know, that nothing has changed?
Easy. It knows the filemtime()
(modified time) of the directory. If the modified time of the dir matches the cache hash, then nothing has changed in the dir, and we can just use the cache. If the dir has changed since the cache was created (both on server and in localstorage), then the cache will NOT match, forcing a reload. This is how cache works.
netmaster apparently it does matter.
I made to you a video, where is clearly visible, that creating new file and moving in and out of this folder do not make it appear in files.gallery. Only manual refresh will do.
https://youtu.be/0dsprfZaiMI
Let me just make a few things 100% clear:
- Video doesn't work "This video is private".
- Even from seeing this, I know exactly what you will show. Yourself navigating around without refreshing the page, and then seeing outdated dirs. Refresh the page or:
- Just disable
javascript_cache
and localstorage_cache
as noted above to NOT cache results in browser.
netmaster I have site, where few automatic processes create many new files every day, and if I log in, there is no new files or even folders visible. Everything seems to be like yesterday. I must press manually refresh inside every folder to see the changes.
You mean you are keeping the app open constantly, never refreshing never exiting to the login page? When you login from login page, Files Gallery will always load changes, if there are changes.
netmaster no, but ping action could do that as well.
I guess you mean "ping" the server, check if there are changes, then reload the page if there are changes?
netmaster I suggested a option, that by entering into folder it could check every time,
See javascript_cache
and localstorage_cache
options as noted above.
netmaster That takes only a millisecond to complete. With 8600 files it took about 3s. in my server.
I'm really not sure what you are talking about. It takes a millisecond, but on your server it takes 3s? What exactly?
What seems a bit strange with this conversation, is that you speak of "when you login, it displays yesterdays content", this is not the case, unless you speak of constantly keeping the app open in browser day after day, never refreshing and never exiting to the login page, even after getting logged out.