1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Groningen, Netherlands
    Posts
    54
    Vote Rating
    0
    Answers
    1
    hermanvandermaas is an unknown quantity at this point

      0  

    Default Answered: Generate application cache manifest file through app.json using Sencha Cmd

    Answered: Generate application cache manifest file through app.json using Sencha Cmd


    Two simple questions...

    I built my app using the latest version of Sencha Cmd with "sencha app build production". It works fine, but not when offline.

    Question 1:
    Do I have to specify all files to be cached in the appCache property of my app.json file, to have the application cache manifest file properly generated?
    Or just specify the .js and .css assets, and the .appcache file should be auto generated?
    Is this different between delta and full update mode?

    Question 2:
    My app did not work offline, so I changed the update mode from "delta" to "full" in the app.json file. Thinking that users who had the older version of my app locally cached on their device would then get a full update, which I think is ok for a very small app.
    Next, I deleted the "builds" and "archives" folders from my local development folder and from the server. After that I generated my app again and uploaded it to the server, All files on the server were overwritten. It's still not working offline though.
    Should this work or do I have to generate a new project, because I have broken the delta update cycle (which sounds evil anyway)?

    My original app.json file:

    Code:
    {
        "name": "myappname",
        "indexHtmlPath": "index.html",
        "url": null,
    
    
        "js": [
            {
                "path": "touch/sencha-touch.js",
                "x-bootstrap": true
            },
            {
                "path": "app.js",
                "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
                "update": "delta"
            },
            {
                "path": "anotherfile.js",
                "update": "delta"
            }
        ],
    
    
        "css": [
            {
                "path": "resources/css/app.css",
                "update": "delta"
            }
        ],
    
    
        "appCache": {
            "cache": [
                "index.html"
            ],
            "network": [
                "*"
            ],
            "fallback": []
        },
    
    
        "resources": [
            "resources/images",
            "resources/icons",
            "resources/startup",
            "favicon.ico"
        ],
    
    
        "ignore": [
            "\.svn$"
        ],
    
    
        "archivePath": "archive",
        "id": "114162dd-cacf-48ea-98ba-1f7ee645a0c3"
    }

  2. You don't have to specify anything for the manifest file. Everything (index.html, js and css files) is cached. Js and Css files are placed in local storage and will not be updated until there is a change in your manifest file.

    We noticed that when using full updates instead of delta updates the manifest isn't changed when publishing the app. So with every release we change the manifest file by adding a version number as comments. This will make sure the app will update on the devices.

  3. #2
    Sencha User
    Join Date
    Nov 2012
    Location
    Netherlands
    Posts
    50
    Vote Rating
    1
    Answers
    6
    eastlander is on a distinguished road

      0  

    Default


    You don't have to specify anything for the manifest file. Everything (index.html, js and css files) is cached. Js and Css files are placed in local storage and will not be updated until there is a change in your manifest file.

    We noticed that when using full updates instead of delta updates the manifest isn't changed when publishing the app. So with every release we change the manifest file by adding a version number as comments. This will make sure the app will update on the devices.

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Groningen, Netherlands
    Posts
    54
    Vote Rating
    0
    Answers
    1
    hermanvandermaas is an unknown quantity at this point

      0  

    Default


    Thanks for your reply, I will try the version number in the .appcache file.