Does Visualforce Cache Setting Affect Session Management?

  • 2
  • Question
  • Updated 9 months ago
  • In Progress
All of our Skuid pages are housed within full-screen Visualforce pages. We've been experimenting with cache="true" and expires=x (where x is the time until the page expires) in the Visualforce pages so as to cache repetitive information, like the nav bar, logo, page structure, etc. Some of our Skuid pages are quite meaty, so this can have a dramatically positive effect, for example reducing the load time for one commonly used page from 5sec to 1sec for every repeat load. But it's raised some questions:
  1. We have a client page with a tabset, and one of the tabs is for Services, which displays a table. I have the VF cache expiry set to 10mins. If I edit one of the services, navigate to another page, then return to the client page (which is clearly being served from cache) and that same service, it displays the old value. If I hard refresh the page (shift-refresh), I get the fresh client page and the new service value. This seems odd, because the Service tab is set to lazy load, and in fact we use a little Javascript to run updateData when the tab shows (to speed up initial load even further). Given that the service data has changed, I'd have thought we'd get the new service value despite the client page being served from cache. Any thoughts?
  2. If we set the expiry time to a high value (say several hours), we've run into issues where the popup message to login again appears. Can't quite understand this. Our session timeout in Salesforce is set to 12 hours and the expiry was set to 8 hours in one test and we were repeatedly seeing the popup. I can test more thoroughly, but I wondered initially on what basis that popup appears.
Thanks heaps.
Glenn.
Photo of Glenn Elliott

Glenn Elliott, Champion

  • 7,738 Points 5k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Glenn Elliott

Glenn Elliott, Champion

  • 7,738 Points 5k badge 2x thumb
A little clarification to my point 1 above. The cache problem with table data only impacts if we have "Load Model data on page load" ticked on for the model. If that's off, and we use our snippet to run updateData when the tab shows (using Zach's approach here: https://community.skuidify.com/skuid/topics/lazy_load_models), then we're not affected by the caching because the data is being requeried. So this actually works fine for us now.

But I'm still very curious about point 2, and to understand any best practices around setting the cache on a Visualforce/Skuid page.
 
(Edited)
Photo of Don Souza

Don Souza, Employee

  • 1,160 Points 1k badge 2x thumb
Are you still experiencing issue #2?
Photo of Dan Boudreau

Dan Boudreau

  • 820 Points 500 badge 2x thumb
@Don Souza - my users are experiencing timeout issues. Our org default is 2 hours but if I turn page caching on at all eventually they'll try and use a Skuid page and get force logged out.