Hello!
My users can't reach fresh content until I don't clear full cache manually.
Steps:
1. Upload a file by admin
2. Open private browser, check your dir listings (filebrowser_node_view called) You see the new file.
3. Upload another file by admin
4. Refresh your private browser (filebrowser_node_view is not called) You don't see the newest file. But the admin sees it.
There is no fresh content!
Do you have any idea?
Comments
Comment #2
kecsotComment #3
clivesj commentedIn D8 the hook node_view changed to utilize the new caching.
If there is no change in the context D8 will not call node_view.
For Filebrowser that was a problem obviously since we uploading outside Drupal context.
We solved it by disabling all caching for the node type dir_listing.
So, every time the browser calls a directory listing node view will be called, Filebrowser makes a trip to the storage and shows the files.
It is a bit expensive but that's the only way I could find so far to circumvent the cache. That's the intended behavior. If it doesn't we have a bug.
We haven't had any complaint since we changed that a long time ago.
I have followed your steps, but can not reproduce.
I printed out a hash for each node_view and confirmed that node_view is called all the time.
But there might be some situation that cache still serves the page.
Do you have the listing in a block? Does it affect non-logged-in users? You have other caching items that may affect?
We might have to drill it down to a specific case.
btw:
If at step 3 you uploaded the file trough the interface you *don't* have to refresh to see the new file as FB refreshes itself.
But if you uploaded outside of FB then indeed you have to refresh.
Comment #4
kecsotI installed a new drupal with composer and I enabled your module.
Then I added new content (directory_listing). url was node/1
Then I repeat my steps from 1-4 and the issue has still happened. (When the private browser is an anonymous user!)
https://www.drupal.org/docs/8/api/cache-api/cache-max-age#s-limitations-...
https://drupal.stackexchange.com/questions/185215/how-do-i-disable-twig-...
So, I added this code after the max-age and it works for anonymous users. (in method filebrowser_node_view )
Please try to reproduce it in a clear new drupal. (8.7.10)
Comment #5
kecsotComment #7
clivesj commentedMaybe it's because of my setup, but I can not reproduce.
But it seems obvious that we need the kill switch for anonymous users. I have added it.
Thank you.