15 Dec 2013 1:09 PM #1
Sencha Cmd Shared Images
Sencha Cmd Shared Images
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 ?
16 Jan 2014 9:40 AM #2
Sorry for bumping. it got really important as we apparently have little storage on the devices running the applications
24 Jan 2014 7:17 AM #3
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
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
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?
24 Jan 2014 7:19 AM #4
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
13 Mar 2014 5:01 AM #5
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.