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

JS files are still cached in browser history after upgrade #5317

Closed
harishbalachandran opened this Issue Oct 4, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@harishbalachandran

harishbalachandran commented Oct 4, 2016

Summary

Coach and Teacher have been using version 0.16.5 over 4 months.

The exercise and videos stops loading after a version update (0.16.7 or 0.16.9) on the servers, this happens on the tablets which the learners use too.

But strangely on deleting the Browsing history the problem seams to get solved both on the coach server and the learner tablets. The browser used is Chrome.

This is a big bummer :( in schools since not only the coach has to delete the browsing history but also all the tablets that has been serving KA lite needs to be clear the browser and we have around 3000+ tablets across the cities.

Is there a workaround for this? I am not sure if this can be addressed using the KA lite, could be a browser issue with cache and cookies doing their part.

System information

Please specify the KA Lite version you were using and your operating system!

  • Operating system: Ubuntu 14.04LTS
  • Version: 0.16.X
  • Browser: Chrome

How to reproduce

  1. Use any version of KA lite over few months on Chrome browser.
  2. Update the server to any later versions.
  3. Access the videos to notice that the exercise does not load.

Screenshots

Will get while we come across this problem in next coach server that we update.

Real-life consequences (anything community should be aware, for instance how it affects your deployment)

This issue is prominent on the tablets that the kids have been using because of which it creates disruption in the classroom, when coach uses the updated server.

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Oct 4, 2016

Member

Hi @harishbalachandran - thanks for reporting this!

If you can help me reproduce the issue, I can definitely figure out a fix for 0.17.

  1. Use any version of KA lite over few months on Chrome browser.

...what I mean is: I can't reproduce that step ;)

Could you perhaps tell me if this case would produce the problem?

  1. Install KA Lite 0.16.5
  2. Load an exercise in Chrome
  3. Upgrade to KA Lite 0.16.9
  4. Load the same exercise in Chrome.

...result: The exercise doesn't load.

Member

benjaoming commented Oct 4, 2016

Hi @harishbalachandran - thanks for reporting this!

If you can help me reproduce the issue, I can definitely figure out a fix for 0.17.

  1. Use any version of KA lite over few months on Chrome browser.

...what I mean is: I can't reproduce that step ;)

Could you perhaps tell me if this case would produce the problem?

  1. Install KA Lite 0.16.5
  2. Load an exercise in Chrome
  3. Upgrade to KA Lite 0.16.9
  4. Load the same exercise in Chrome.

...result: The exercise doesn't load.

@benjaoming benjaoming changed the title from Exercise and videos stop loading after the version update. to JS files are still cached in browser history after upgrade Oct 4, 2016

@benjaoming benjaoming added the bug label Oct 4, 2016

@benjaoming benjaoming added this to the 0.17.0 milestone Oct 4, 2016

@harishbalachandran

This comment has been minimized.

Show comment
Hide comment
@harishbalachandran

harishbalachandran Oct 6, 2016

Thanks @benjaoming I guess you should be able to reproduce just by following the steps you mentioned. The reason I said use KA lite for few months is because that's when all the JS files are cached and conflicts with the latest version I suppose.

harishbalachandran commented Oct 6, 2016

Thanks @benjaoming I guess you should be able to reproduce just by following the steps you mentioned. The reason I said use KA lite for few months is because that's when all the JS files are cached and conflicts with the latest version I suppose.

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Nov 29, 2016

Member

What happens is this:

  1. Upon the first request and response, the server reponds with an HTTP header containing:

    Date: Tue, 29 Nov 2016 14:08:04 GMT
    Last-Modified: Mon, 28 Nov 2016 16:46:53 GMT
    
  2. Upon requesting the same file again, the client will ask with the following request:

    If-Modified-Since: Mon, 28 Nov 2016 16:46:53 GMT
    Cache-Control: max-age=0
    

    ...and should then receive a response 304 if the file hasn't changed. However, if I do change the file, I still get a 304.

This should all be fine, but it doesn't actually work.

Cherrypy just returns 304 despite the file having been both 1) changed and 2) having a newer timestamp than my If-Modified-Since.

Member

benjaoming commented Nov 29, 2016

What happens is this:

  1. Upon the first request and response, the server reponds with an HTTP header containing:

    Date: Tue, 29 Nov 2016 14:08:04 GMT
    Last-Modified: Mon, 28 Nov 2016 16:46:53 GMT
    
  2. Upon requesting the same file again, the client will ask with the following request:

    If-Modified-Since: Mon, 28 Nov 2016 16:46:53 GMT
    Cache-Control: max-age=0
    

    ...and should then receive a response 304 if the file hasn't changed. However, if I do change the file, I still get a 304.

This should all be fine, but it doesn't actually work.

Cherrypy just returns 304 despite the file having been both 1) changed and 2) having a newer timestamp than my If-Modified-Since.

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Nov 29, 2016

Member

I've upgraded to cherrypy 3.3.0 and the problem has immediately gone away. Unfortunately there doesn't seem to exist release notes for this version:

https://github.com/cherrypy/cherrypy/blob/master/CHANGES.txt#L282

The full changeset is here:

cherrypy/cherrypy@cherrypy-3.2.2...3.3.0

Seeing that the upgrade fixes an important bug, I'm going to introduce the upgrade. We might wanna read through the full list of CherryPy updates to know if we should make the big jump to 8.1.2 (latest version). Perhaps since it's in use for Kolibri, we can gain some experience from there...

Member

benjaoming commented Nov 29, 2016

I've upgraded to cherrypy 3.3.0 and the problem has immediately gone away. Unfortunately there doesn't seem to exist release notes for this version:

https://github.com/cherrypy/cherrypy/blob/master/CHANGES.txt#L282

The full changeset is here:

cherrypy/cherrypy@cherrypy-3.2.2...3.3.0

Seeing that the upgrade fixes an important bug, I'm going to introduce the upgrade. We might wanna read through the full list of CherryPy updates to know if we should make the big jump to 8.1.2 (latest version). Perhaps since it's in use for Kolibri, we can gain some experience from there...

benjaoming added a commit to benjaoming/ka-lite that referenced this issue Nov 29, 2016

@benjaoming benjaoming added the has PR label Nov 29, 2016

benjaoming added a commit that referenced this issue Nov 29, 2016

Merge pull request #5346 from benjaoming/static-caching
Cautiously upgrade CherryPy to 3.3.0 - fixes #5317
@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Nov 29, 2016

Member

Fixed in #5346

Member

benjaoming commented Nov 29, 2016

Fixed in #5346

@benjaoming benjaoming closed this Nov 29, 2016

@benjaoming benjaoming removed the has PR label Nov 29, 2016

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Nov 29, 2016

Member

Thanks for the reportback, @harishbalachandran - it was a critical bug indeed! Please let me know if you experience any further problems -- but I feel confident in saying that it's all working now since I could reproduce and verify it was fixed pretty easily :)

Member

benjaoming commented Nov 29, 2016

Thanks for the reportback, @harishbalachandran - it was a critical bug indeed! Please let me know if you experience any further problems -- but I feel confident in saying that it's all working now since I could reproduce and verify it was fixed pretty easily :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment