Comments (8)
Either solution SGTM. Worth researching with one you think makes more sense, run some tests and take the decision. Let me know.
from senna.js.
Here are my findings: the best way to deal with caching for the RequestScreen is to not try to handle it at all. Just let the browser / server do it using ETags or whatever caching policy it's used. The developers just have to follow the standards (on the HTTP level, not HTML Pragma / Cache-Content meta tags).
from senna.js.
I assumed that leveraging http default cache machanism was the default behavior.
I am curious, what was the original motivation for using an alternative cache method?
from senna.js.
Senna is a spin-off of AlloyUI's surface module, which is used by the Liferay portal.
The reason why a JS-based caching mechanism was implemented there was because we needed it for some custom screens on the Liferay portal project.
How come this JS-based caching mechanism might be useful? Imagine you've some custom screens that are generated on the client-side or receive POST* request data. A JS-based caching mechanism is the way to go to improve performance.
- Bad HTTP verb choice, for sure.
from senna.js.
Yeah, it makes sense.
For "senna" standalone project though, the POST request case is something to be considered if #59 is ever implemented. In that case it is a valid http verb.
from senna.js.
This doesn't relate with #59 directly.
A PostScreen could, theoretically, make use of it, but it's an abuse. We had this special case where caching it helped us achieve our goals due to legacy code that is going to be rewritten at some point (and was risky to change right now).
POST requests MUST NOT be cached, unless the response includes Cache-Control or Expires headers, which in this case will be automatically resolved by the browser and Senna MUST NOT deal with it.
References:
9 Method Definitions
13 Caching in HTTP
from senna.js.
Sure, standards should be respected.
I mentioned that it could be considered because there is is some evidence that most browsers were not that consistent in handling POST request caching. But that was long ago and this is probably not an issue anymore, haven't tested it.
from senna.js.
This should be enough for now https://github.com/liferay/senna.js/blob/master/src/app/App.js#L241. Thanks!
from senna.js.
Related Issues (20)
- Senna does not correctly evaluate favicon when page changes
- Turn Cache on Screens off HOT 4
- endNavigate when instantiated via data attributes HOT 3
- Senna.js not working when navigating between pages when using a Web Server + SSL on IE11 HOT 2
- Browser support matrix doesn't mention support for any browser other than Edge in Windows 10 HOT 14
- Query appending to IE11 link
- Page keyword metatag is not being refreshed after page navigation HOT 2
- how to use asp.net mvc scene? HOT 1
- In IE11, media queries in style tags with data-senna-track attributes are applied as though the page has a width of 0px HOT 14
- Add custom behavior when a Redirect happens (302) HOT 4
- Senna moves focus away from autoFocus fields on refresh HOT 3
- Start navigation on mousedown instead of on click HOT 2
- Redirect Path passed to the historyState don't support hashes
- Back button reloads the inital page HOT 1
- How to flip a specific surface only? HOT 1
- Dynamically added classes to the head element gets removed on page change HOT 1
- Branch 3.x and move 2.x to master
- Cleanup long-standing PRs HOT 3
- Mio de mi HOT 1
- Saving app.screens into localStorage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from senna.js.