Comments (8)
IE 11, shame on you!
from react-tutorial.
+1 I have exactly the same problem in my app using React 0.12.2 for state updated from a core.async go-loop. A huge issue for us here so if there are any workarounds, they'd be greatly appreciated.
from react-tutorial.
As far as I can tell, this is simply a http caching problem. The tutorial fetches the comments from the server on an interval and updates the DOM. Unlike other browsers, IE11 doesn't even attempt to contact the server, and use the local copy instead, so ETag doesn't help.
Since POST requests aren't cached, you'll get to see the latest comments for a brief moment after submitting a comment.
I'm not an expert at caching and best practices, but this seems to fix it:
// server.js
fs.readFile('_comments.json', function(err, data) {
res.setHeader('Content-Type', 'application/json');
res.setHeader('Cache-Control', 'max-age=0, private, must-revalidate'); // new header
res.send(data);
});
from react-tutorial.
IE 11, shame on you! :) It seems that it may also be the case here so it's
probably a false alarm too. It's just that debugging with beeps (to keep
the Console off) does take more time. I'll post a confirmation as soon as I
know for sure that it indeed is the cause.
On Thu, Feb 26, 2015 at 7:37 PM, Alexander Gundermann <
[email protected]> wrote:
As far as I can tell, this is simply a caching problem. The example
fetches the comments from the server on an interval and updates the DOM.
Unlike other browsers, IE11 doesn't even attempt to contact the server, and
use the local copy instead, so ETag doesn't help.Since POST requests aren't cached, you'll get to see the latest comments
for a brief moment after submitting a comment.I'm not an expert at caching and best practices, but this seems to fix it:
// server.js
fs.readFile('_comments.json', function(err, data) {
res.setHeader('Content-Type', 'application/json');
res.setHeader('Cache-Control', 'max-age=0, private, must-revalidate'); // new header
res.send(data);
});—
Reply to this email directly or view it on GitHub
#33 (comment)
.
from react-tutorial.
Thanks taurose, you're right, Adding cache control solved the problem. For the tube-tracker issue, it's another IE specific issue.
Hope IE's new brother: Spartan browser can do better.
I added a pull request, so other people won't get frustrated when running this tutorial with IE.
from react-tutorial.
I confirm that it also solved the problem here. Good job!
On Fri, Feb 27, 2015 at 8:26 AM, top2tech [email protected] wrote:
Thanks taurose, you're right, Adding cache control solved the problem. For
the tube-tracker issue, it's another IE specific issue.Hope IE's new brother: Spartan browser can do better.
I added a pull request, so other people won't get frustrated when running
this tutorial with IE.—
Reply to this email directly or view it on GitHub
#33 (comment)
.
from react-tutorial.
add the no-cache header can solve the problem , thanks
from react-tutorial.
Watch out for this as well: aurelia/framework#227 referencing chakra-core/ChakraCore#1415
I had a very similar issue as described here. It turned out not to be the caching (though the symptoms sure seemed to point to caching), it was actually this bug instead in IE Edge. Microsoft patched it, but it's still not released. The fix is relatively simple - you just add: <script> Function.prototype.call = function(t) { return this.apply(t, Array.prototype.slice.apply(arguments, [1])); } </script>
to your head section or something. Could probably put it in your app too.
Strange bug that presents itself as a caching issue. Simple, if ugly, fix.
from react-tutorial.
Related Issues (20)
- Comment data array introduced in the Updating state section
- GET /place/:id/roommate/:id
- PUT user needs to issue a user Update notification
- Warning: React.render is deprecated. HOT 2
- Prohibitive license conuterproductive to educational materials? HOT 1
- Race condition in refresh code HOT 1
- SecurityError: The operation is insecure browser.js HOT 1
- Please add a license field in package.json HOT 1
- Stored XSS in Mark Down HOT 5
- Uncaught SyntaxError: embedded: Unexpected token (18:8) HOT 1
- Better visualisation of component hierarchy? HOT 1
- Convert from React.createClass to ES6 classes HOT 1
- npmcdn can't find react js file HOT 2
- api/comments HOT 1
- Incorrect link to Facebook site HOT 1
- Incorrect link to Facebook site HOT 4
- Uncaught SyntaxError: embedded: Unexpected token (30:54) HOT 2
- started error
- Data output with order by created_at HOT 1
- What is the purpose of 'key' in example.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 react-tutorial.