0

I am observing a strange behaviour. I have some HTML/JS files. I am using SimpleServer as web server. I notice that the latest version of one particular file is not uploaded even after I change that file. When I inspect the file using browser's developer tools, I still see old code. What could be the reason?

The file in SpecHelper.js. It is included in index.html as follows

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>Jasmine Spec Runner v2.3.4</title>

  <link rel="shortcut icon" type="image/png" href="lib/jasmine-2.3.4/jasmine_favicon.png">
  <link rel="stylesheet" type="text/css" href="lib/jasmine-2.3.4/jasmine.css">

  <!-- App Dependencies -->
  <script src="lib/jquery-2.1.4.js"></script>
  <script src="/vendor.js"></script>

  <!-- Test libraries -->
  <script type="text/javascript" src="lib/jasmine-2.3.4/jasmine.js"></script>
  <script type="text/javascript" src="lib/jasmine-2.3.4/jasmine-html.js"></script>
  <script type="text/javascript" src="lib/jasmine-2.3.4/boot.js"></script>

  <!-- include source files here... -->
  <script type="text/javascript" src="/app.js"></script>

  <!-- include spec files here... -->
  <script type="text/javascript" src="SpecHelper.js"></script>
  <script type="text/javascript" src="app_spec.js"></script>
</head>

<body>
    <p>test </p>
  </body>
</html>

If I change index.html or app_spec.js, I can see the changes but if I change SpecHelper.js, I still see the old code! I am debugging SpecHelper.js and this is not helping!

Manu Chadha
  • 15,555
  • 19
  • 91
  • 184

1 Answers1

0

In case of Google Chrome browser: did you try chrome's "empty cache and hard reload" option after right-clicking to the refresh button with opened dev tools window? You should try to open the page in an incognito or private browser window too.

  • sorry, I do not follow. – Manu Chadha Aug 11 '17 at 15:23
  • I notice that if I change the server to live-server, then the problem is solved! – Manu Chadha Aug 11 '17 at 15:23
  • got it working..phew ... had to clear browser cache by going to developer tools, networks. I noticed that most files were being picked from memory. Right clicked and cleared cache and cookies. Is this what you were recommending as well? – Manu Chadha Aug 11 '17 at 15:55
  • I didn't recommend exactly the same solution, I recommended a faster way to reload javascript files (maybe it's not an equivalent method, but useful for js files): http://www.code-pal.com/quick-tip-clear-cache-hard-refresh-on-chrome/ . There is a thread discussing the difference between reload methods: https://stackoverflow.com/questions/14969315/whats-the-difference-between-normal-reload-hard-reload-and-empty-cache-a – Kristóf Kőhalmy Aug 14 '17 at 14:22