Comments (8)
With your suggestion every session will be overloaded with a lot of text-size-determination requests, which will trigger the UI re-layout (flickering). As a result the server performance will degrade with too many sessions in parallel.
from org.eclipse.rap.
Agreed, this won't come for free - that is why this cache was implemented in the first place. However it was proposed to make it optional via a switch and leave caching enabled by default, so in case users experience problems, they at least have the ability to turn it off instead of restarting the application regulary.
The reason my proposal is so drastic is that current implementation simply isn't robust - measure text once and if it matches take for granted the client will render all other texts the same way too requires some luck ;)
The only solution I can think if to make it really solid and keep caching in place is to re-validate each cached measurement again on the client and re-measure / re-layout in case a mismatch is detected. However I guess this would mean quite a lot of infrastructure work within rwt...
from org.eclipse.rap.
Clemens, as it seems that you already have a "solution" in hands, it will not hurt to provide a patch (pull request) and discuss the details on top of it.
from org.eclipse.rap.
I implemented it a few years ago for a customer where the cache caused issues with session-replication inside a cluster (requests were randomly redirected to different cluster-nodes by the load-balancer which caused endless re-measure/re-layout loops). I'll dig it out and try to port it.
from org.eclipse.rap.
Something came to my mind. In RAP theming the default font is defined as "family" of fonts like:
font: 14px Verdana, "Lucida Sans", Arial, Helvetica, sans-serif;
Is it possible that the text size measurement is different for Verdana vs Arial vs Helvetica in different systems (browsers)? The overall RAP font probe size will be the same (cached), but if one browser is using Verdana and other Arial and the sizes differ than the described issue is possible.
from org.eclipse.rap.
@ceisserer Did you ever try with single font name?
from org.eclipse.rap.
@ifurnadjiev I thought about this scenario, but I guess it is handled correctly by the probe approach.
In case one browser falls back to Helvetica instead of Arial, this will already happen when the initial probe is computed. So the server-side cache would detect this browser measures differently compared to all other browsers which were using Arial and returned the same result for the probe, whereas this one returned a different initial-probe-result for Arial.
from org.eclipse.rap.
@ifurnadjiev I've opened a pull request to illustrate how storing the text meausrements in the session could work. I had deployed this approach in a production environment ~2017.
from org.eclipse.rap.
Related Issues (20)
- Retry on connection error doesn't work with CSP enabled
- Handling network connection error with SeverPush active HOT 7
- Missing requirement: org.eclipse.rap.rwt.osgi 3.22.0.20220708-1200 requires 'java.package; javax.servlet [4.0.0,5.0.0)' but it could not be found HOT 3
- RAP version which support jboss8 and openjdk17 HOT 7
- Ampersand character ommited from label text HOT 1
- selection in not yet focused multiline Text widget HOT 2
- CSRF security HOT 2
- Focus issues with ContextMenu in Chrome/Edge browser
- pack column for Tableviewer
- Copy of photo is stored on server and never cleaned up
- Support for SVG Images for Actions, Commands and Menu's for HighDPI and zooming support
- Missing RAP artifacts in maven central HOT 2
- JS crash in rwt.event.DomEvent.isAltGrPressed() while drag'n'drop HOT 1
- [Grid] Index out of bounds exception when using cell selection and setItemCount HOT 2
- org.eclipse.rap.rwt.client.service.ClientInfo.getClientTimezoneOffset() returns invalid value after a daylight saving change
- Infinite loop in RAPDragTracker
- Memory leaks using Display.timerExec with push session active
- RAP version which support jboss8 HOT 17
- Improve deployment of realease artefacts to Maven Central
- Wrong handling error in ServerPush.js / Connections.js 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 org.eclipse.rap.