4 Replies Latest reply on Dec 11, 2012 12:57 AM by Ameer Ilahi

    How to disable Page Cache on RE 1.0.3.11

    Venkatasubbaiah Chenna

      Hi

       

      Please let me know how to configure RE to does not cache pages.

       

      I have added these line in my code.

       

       

      <meta http-equiv="cache-control" content="no-cache">

      <meta http-equiv="pragma" content="no-cache">

       

      thanks

      Chenna

        • Re: How to disable Page Cache on RE 1.0.3.11
          Benedict Kennedy

          I havent been able to replicate RhoElements caching pages.

           

          To be safe, you could change those meta tags to:

           

          <meta http-equiv="Cache-Control" content="max-age=0">
          <meta http-equiv="Cache-Control" content="no-cache">
          <meta http-equiv="expires" content="0">
          <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
          <meta http-equiv="Pragma" content="no-cache">
          

           

          The best way to stop page caching is to change the server headers to stop the caching there, but this may not be available depending where the files will be stored.

           

          Regards,

           

          Ben

            • Re: How to disable Page Cache on RE 1.0.3.11

              Hi Benedict,

              i am using Ehoelements 2.2.1.12 and believe that pressing the back buttons on a page is causing to load the page from the cache (data being displayed is not up to date).

              i have added to the above suggested meta tag to the layout.erb file for the application, however after adding them i am seeing the following entries in the log file:

               

              I 12/10/2012 14:50:06:105 082dd672 Core::CMeta::GetModule| Plug-in: cachecannot be found in Plugin.xml

              W 12/10/2012 14:50:06:106 082dd672 Core::CMeta::SetPlugProperty| Module cache not found.

              I 12/10/2012 14:50:06:108 082dd672 Core::CMeta::GetModule| Plug-in: cachecannot be found in Plugin.xml

              W 12/10/2012 14:50:06:109 082dd672 Core::CMeta::SetPlugProperty| Module cache not found.

              I 12/10/2012 14:50:06:111 082dd672 Core::CMeta::GetModule| Plug-in: expirescannot be found in Plugin.xml

              W 12/10/2012 14:50:06:113 082dd672 Core::CMeta::SetPlugProperty| Module expires not found.

              I 12/10/2012 14:50:06:115 082dd672 Core::CMeta::GetModule| Plug-in: expirescannot be found in Plugin.xml

              W 12/10/2012 14:50:06:116 082dd672 Core::CMeta::SetPlugProperty| Module expires not found.

              I 12/10/2012 14:50:06:118 082dd672 Core::CMeta::GetModule| Plug-in: pragmacannot be found in Plugin.xml

              W 12/10/2012 14:50:06:120 082dd672 Core::CMeta::SetPlugProperty| Module pragma not found.

              is there something that needs enabling in the Plugin.xml file?

              i also get a similar error for the viewport meta tag:

              I 12/10/2012 14:50:06:122 082dd672 Core::CMeta::GetModule| Plug-in: viewportcannot be found in Plugin.xml

              W 12/10/2012 14:50:06:123 082dd672 Core::CMeta::SetPlugProperty| Module viewport not found.

               

              thanks.

                • Re: How to disable Page Cache on RE 1.0.3.11
                  Benedict Kennedy

                  Hi Ameer,

                   

                  These log messages are nothing to worry about. These are coming from RhoElements to say that those META tags aren't recognised as RhoElements Modules (plugins).

                  This is reported because RhoElements supports the "EMML" language which allows the developer to define settings for our Device Feature modules which is done by using META tags. As "Cache-Control", "Expires" and "Pragma" are HTTP/HTML messages and not RhoElements modules RhoElements reports that it can't understand them just in case the developer mis-spelt a real RhoElements module, or hasn't included a module in the Plugin.xml file. These values are still read and understood by the WebKit browser inside RhoElements.

                   

                  This is an interesting use-case which I haven't thought of before, regarding caching and the back key. Unfortunately I don't know the resolution for this, I am wondering if there is an easy fix in the rhoconfig.txt or similar? Hopefully someone will know on here.

                   

                  Anyone?

                    • Re: How to disable Page Cache on RE 1.0.3.11

                      hi Benedict,

                      thanks for the clarification on the metatags.

                      just to explain what is happening:

                      my application lists a number of jobs to the user. each listed job has a button to update the status of the job as follows:

                      1. change status to 'Status 1' by calling an action on the controller and navigating to the same view
                      2. change status to 'Status 2, by calling an another action on the controller and navigating to Page 2
                      3. On Page 2, there is a button, coded as
                      <a href="<%= url_for :action => :index , :query => {'someID' => @showID}%>" class="ui-btn-left" data-iconpos="top"  data-icon="arrow-l"> Back </a>
                      

                       

                            to take the user back to Page 1. however when the page is loaded instead of showing the status of job as 'Status 2' it shows 'Status 1'.

                       

                      Page 2 also has another button which when clicked changes the status of the job to 'Status 3' and navigates the user to page 1 which when loaded shows the correct status for the job.

                       

                      i have added some logging in the index action of the Page 1 to see if a log entry is created or not and have found the when the Back button on Page 2 is clicked the log entry is not created, confirming that the page is loaded from the cache.