Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested references not updating #237

Open
raphaelbs opened this issue Apr 21, 2018 · 0 comments
Open

Nested references not updating #237

raphaelbs opened this issue Apr 21, 2018 · 0 comments

Comments

@raphaelbs
Copy link

First of all I like to thank you for the effort put in this project. I learned a lot poking around here and I value the good job made.

Context

I work in a company that uses this plugin for a very long time, I believe it's been two years or so.
We were using the 1.3.0 version for the past year and we always have some issues with cache, despite using the cache bust in our grunt tasks.
Two days ago I began my quest to isolate the problem and here's what I found.

Cenario

The most complex structure we are using are the following (please feel free to give sugestions):

index.html

...
<body>
  <script src="src/config/lazyLoadConfig.js" type="text/javascript"></script>
</body>
...

lazyLoadConfig.js

...
// using $ocLazyload
modules: [
  {name: 'moduleX', files: ['src/component/compX.js']}
]
...

compX.js

angular.module('main').component('comp', {
    templateUrl: 'src/component/compX.html'
})

compX.html

<h1>hi there</h1>

Issue

With the above strutuce, even if I update the compX.html, the hash of compX.js stays the same because the current flow of hashing does not re-hash the file once changed.

Example before change the compX.html:

  • index.html → index.html
  • lazyLoadConfig.js → lazyLoadConfig.345.js
  • compX.js → compX.abc.js
  • compX.html → compX.def.html

Example after change the compX.html:

  • index.html → index.html
  • lazyLoadConfig.js → lazyLoadConfig.345.js // this file name do not changed =(
  • compX.js → compX.abc.js // this file name do not changed but the content is now pointing to compX.1ae.html
  • compX.html → compX.1ae.html // the file name changed as expected

That way, when the browser needs to load the lazyLoadConfig.345.js or even the compX.abc.js, it fetches from cache because nothing apparently changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant