3 Replies Latest reply on Jul 14, 2009 10:26 PM by leybniz

    How does Flex cache images??

    ProjectedSurplus Level 1

      To my understanding, in straight HTML the browser caches image files such that upon return visits (all other things being equal) the browser obtains the image from a browser cache rather than re-downloading.


      Does/can flex make use of the same browser cache?   More specifically, if my flex app downloads a large image file; then the visitor closes his/her browser before reopening it and navigating back to my flex app URL where does the same large image file come from, the imageServer again or from some sort of cache?


      For that matter is the flex app itself cached by the browser such that (assuming no changes were made between visits) a return visit to my flex app url does NOT require the re-download of the app from the server (I know HTML has this capability but not sure about the HTML "wrapper page" which launches the flex app).



      Thanks in advance,

        • 1. Re: How does Flex cache images??
          leybniz Level 4

          If the browser is IE and FP is an ActiveX then yes, FP utilizes IE cache for all http queries.

          1 person found this helpful
          • 2. Re: How does Flex cache images??
            ProjectedSurplus Level 1

            Sorry for being newbie obtuse but are you saying that FP (Flex Project I assume)'s are an Active X (application) and thus IE does utilize its cache for all HTTP based communications???


            If so then as I understand it, the typical Flex Project has an HTML wrapper which then loads the Flex App (I assume using HTTP).  Subsequent Flex<--->Server communications can be HTTP or other format (AMF which I believe BenForta indicated was HTTP "wrapped" as well but at the moment I am less concerned with this).


            As such is the following correct?


            1.)  IE Browser hits HTML page (url) ----> IE checks its cache; If exists compares vs current version on server; If different download from server else load from cache


            2.)  HTML page calls Flex App (using HTTP???) ----> IE again compares Flex App in cache (if exists) vs. server and if same load else download


            3.)  Flex App retrieves image file names via <mx:RemoteObject> ----- I don't see how browser cache can be used here as results not known until after dbase query completes


            4.)  Flex App uses <mx:RemoteObject> results to retrieve large .jpg files  ---- do these "pass through" the browser (and therefore load and/or store in cache) or are they purely "Flex contained" (and if so does flex have any automatic cache or do I have to perhaps store the jpgs in a shared object if I hope to reuse them without a download)???

            • 3. Re: How does Flex cache images??
              leybniz Level 4

              FP = Flash Player, it can be used in form of ActiveX control for MS Windows platform and as a plugin for third parties browsers like: FireFox, Opera, etc.


              1) Yes


              2) Somewhat yes, HTML wrapper page, should download the Flex application .swf file, and this file also URL and applicable for point 1) as well


              3) Yes, RemoteObject requests not cached, since they are binary and internal implementation have an facility to prevent them from being cached.


              4) Yes, you could relay on Browser cache as well as relay on SharedObject cache, but this one you'll have to handle yourself, you'll have to build some API for yourself which will be responsible for caching selected information to SharedObject and retrive on demand, the only difficulty you might have with that approach is that end user will be prompted to allow a lot storage space for your application/website.