Hi Sander, I recently faced the same issue. After some digging, I finally found the root cause is the modification date of template HTML files are too old. I found that if your template files modified earlier than 1997-0726 05:00, the issue would happen.
Note that my testing web server is lighttpd, other webservers may have a similar issue but the date may vary. For example, you can execute the following command to reproduce this issue or fix the issue, where the *.html file are angular template files. 1. Reproduced issue. date -s "199707260500" && touch login.html; touch status.html 2. Fix the issue. date -s "199707260501" && touch login.html; touch status.html BR, Guoshun 在 2017年7月11日星期二 UTC+8下午12:01:13,Sander Elias写道: > > Hi Anne, > > This is so much outside the reach of angular! A 304 means the server say's > to the browser, there is no change in this file, you can use your cached > version. They only way to get a 304 is when there is indeed a cached > version, otherwise, the file would just get pulled, like every other > resource. The only way to get an error is when the cached version of the > resource is corrupted somehow. As this all play's inside the internals of > the browser, there is no way you can any influence on this using JS. > The only other possible scenario is that the server gives a 304 in fault. > that means the server tells the browser, nope, you should have this file, > while it doesn't. I believe of the 2 this is the most likely thing to > happen. However, as this is an error in the server, there is nothing you > can do in JS again to fix this. > > However, you might be able to catch the error in JS, and retry the > request. This has to be done outside AngularJS. I think the "easy" solution > is to use a service-worker. Most browsers support those nowadays. > > Regards > Sander > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/2776cb5f-5c3d-4e92-bd04-e65edc3208a0%40googlegroups.com.
