Results 1 to 5 of 5

Thread: Microloader, localStorage, cache.manifest

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    23
    Vote Rating
    1
      0  

    Default Microloader, localStorage, cache.manifest

    Hi,

    I have following code in app.json:
    Code:
    "js": [        
    {
             "path": "app.js",
             "bundle": true,  
             "update": "delta"
         }        
    ],
    and in cache.manifest:
    Code:
    # d5db6d2b81a9dda1c37d6f6ce071f8892396f0fe
    app.js
    which changes if I update the file.

    After the file has been stored in localStorage it doesn't update although a hash with new delta in cache.manifest changes. In the result a new version of my app doesn't show up in the browser (Chrome).

    The app was build with sencha tools with command: sencha app build production

    Do I miss something?

    Thanks in advance for help.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    You shouldn't put app.js in the cache.manifest, app.js will be stored in localStorage
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    23
    Vote Rating
    1
      0  

    Default

    Ok, I've removed it from cache.manifest, but it goes to localStorage and has not been updated thou.

    HTML5 documentation says at when cache.manifest changes, files are going to be refreshed. Does it not work similar in Sencha with localStorage caching?

    Here http://www.sencha.com/learn/taking-s...-apps-offline/ James Pearce shows an example of cache manifest:
    CACHE MANIFEST
    index.html
    app/app.js
    lib/touch/sencha-touch.js
    lib/touch/resources/css/sencha-touch.css
    and he puts <html manifest="app.manifest"> at the top of index.html. Should I add it manually after Sencha SDK Tool does its jobb or should I leave it as it is.

    Thanks for help!

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    The localstorage mechanism makes an Ajax request to app.json and if successful it sees if there are any delta updates. If so then it attempts to load them. Once they are loaded it will prompt the user to refresh the page as there was an update applied.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    23
    Vote Rating
    1
      0  

    Default

    Ok, so I see at there is an issue with external resources. I've read at it is impossible in Sencha to request external url in the way: http://url.toexternalscript.com/scripts/s.js or /scripts/s.js if it is on the same server.

    When I am building an app I am getting an error at:
    Code:
    ENOENT, no such file or directory 'C:\[path]\m\scripts\s.js'
    or
    Code:
    Uncaught ReferenceError: Ext is not defined
    When I edit already minified app.json.

    I hope you can help me with that. I've searched forum and google it but I've never found good unswer to solve the problem. Then everyone could find the way how to fix that problem.

    Greetings

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •