1. #1
    Sencha Premium Member MichaelOstrovsky's Avatar
    Join Date
    May 2008
    Location
    Tel Aviv, Israel
    Posts
    135
    Vote Rating
    6
    MichaelOstrovsky is on a distinguished road

      0  

    Default Sencha Cmd Shared Images

    Sencha Cmd Shared Images


    Hello,
    We have a workspace with few pages (ExtJs apps) , all of them using the same theme (package).
    The theme has many images , which after app compilations are stored in each one of the pages (apps) seperately.
    This causes a waste of storage , and worst of all- it prevents from caching the images on clients browser.
    Is there a way to have the theme images stored in one place ?
    Thanks

  2. #2
    Sencha Premium Member MichaelOstrovsky's Avatar
    Join Date
    May 2008
    Location
    Tel Aviv, Israel
    Posts
    135
    Vote Rating
    6
    MichaelOstrovsky is on a distinguished road

      0  

    Default


    Anyone ?
    Sorry for bumping. it got really important as we apparently have little storage on the devices running the applications

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Posts
    79
    Vote Rating
    5
    HriBB is on a distinguished road

      1  

    Default


    Hey.

    I have a similar problem with a "slight" difference I have one ExtJS web app and one Sencha Touch android app. I think that dynamic content such as uploaded images should be available through something like http://cdn.domain.com/uploads/ for both apps, even though ST app is native. Not sure about static content in my case. Probably it needs to be duplicated in both apps, since android apps are packed into .apk with phonegap/cordova and should not load static resources from the web. But in your case, I think you should put shared resources on a common CDN. You can also control which folders are merged into which app with sencha cmd. It depends on how you structured your apps. Here's my idea on how it should be done.

    FOLDER BASED APPROACH

    http://domain.com/app1/
    http://domain.com/app2/
    http://domain.com/app3/

    Resources could be app specific and shared.

    http://domain.com/app1/resources/ - app1 specific
    http://domain.com/app2/resources/ - app2 specific
    http://domain.com/app3/resources/ - app3 specific
    http://domain.com/resources/ - shared resources

    DOMAIN BASED APPROACH

    http://app1.com/
    http://app2.com/
    http://app3.com/

    Resources should be in

    http://app1.com/resources/ - app specific
    http://app2.com/resources/ - app specific
    http://app3.com/resources/ - app specific
    http://cdn.company.com/ - shared resources

    Any thoughts, ideas, improvements?

  4. #4
    Sencha User
    Join Date
    Apr 2010
    Posts
    79
    Vote Rating
    5
    HriBB is on a distinguished road

      0  

    Default


    In your case, I think you should move shared resources out of the package and into workspace resources folder. Then when you're publishing, just upload those resources on shared CDN

  5. #5
    Sencha Premium Member MichaelOstrovsky's Avatar
    Join Date
    May 2008
    Location
    Tel Aviv, Israel
    Posts
    135
    Vote Rating
    6
    MichaelOstrovsky is on a distinguished road

      0  

    Default


    Thanks, seems I'll indeed need to make a dedicated folder with shared images and somehow tweak the build scripts and sass to use them. The downside is that I loose all the benefits of sencha theme package and cascading of resources.

    Other approach I thought of is making another 'stub' app which will 'require' all the shared components. then, all the other apps will point to that app's resources.

    Both of the approaches unfortunately involve a degree of hacking and struggling.
    It would be nice to have some kind of advice / guide/ best-practice from Sencha for shared resources in multipage apps - It's not an uncommon practice imho.

    p.s. a cdn is not an option in my particular case. It runs on devices in (often) offline environments, not on a public web-server. and those devices have a limited storage, which is unresponsible to waste with many duplicate resources.

    Thanks

Thread Participants: 1

Tags for this Thread