Improper caching of instance data

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Improper caching of instance data

Clark, John
For some forms, it appears that the Mozilla XForms Extension is incorrectly caching instance data that has changed since the last load of the form.  In the forms where we are seeing this behaviour, we load a resource into an instance with <xf:instance src="some:resource" id="i"/>.  We then modify the content of instance "i" in our form, and we have a submission that uses `method="put"` to put the result directly back to "some:resource".  When we load the form again (by navigating back to it, not by performing a browser "reload"), the form displays the instance data as it existed before the last modifications.  Performing a browser reload causes the form to load the new data.

Examining a HTTP log indicates that on the second request, no HTTP request is made for the instance resource (although these resources are being transported over HTTP).  Also, the browser is not sending an `If-Modified-Since` header for any resources related to loading an XForms document.

Is something wrong with the way that XForms is doing caching of retrieved resources?  Is anyone else seeing behaviour such as this?  Should I file a bug about this?

Thanks,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Improper caching of instance data

Aaron Reed
Hey John,

Is this a simple form where you change some instance data in a single
instance document (which it sounds like in your description is an
external instance document) and then go off to another page?  Or is this
something where you change some instance values in a second instance
document, submit them off to a server who updates the first instance
document on the server?

The way that browser caching works is that a whole new page reload
doesn't happen when you navigate back in history, so an xform won't know
to go off and ask for the remote instance document again.  However, I
assume that we haven't deleted the current instance document, so if you
had made changes to the instance document and navigated back to the
form, it should still have those changes, I'd think.

I guess without a testcase I won't know if it is behaving correctly or not.

If you want to be sure that your page works, just make your form not
cache then you shouldn't have a problem...the browser will load it new
every time (<META HTTP-EQUIV="Pragma" CONTENT="no-cache">).  Course this
is theory...I haven't tested it myself :-)

--Aaron

Clark, John wrote:

> For some forms, it appears that the Mozilla XForms Extension is incorrectly caching instance data that has changed since the last load of the form.  In the forms where we are seeing this behaviour, we load a resource into an instance with <xf:instance src="some:resource" id="i"/>.  We then modify the content of instance "i" in our form, and we have a submission that uses `method="put"` to put the result directly back to "some:resource".  When we load the form again (by navigating back to it, not by performing a browser "reload"), the form displays the instance data as it existed before the last modifications.  Performing a browser reload causes the form to load the new data.
>
> Examining a HTTP log indicates that on the second request, no HTTP request is made for the instance resource (although these resources are being transported over HTTP).  Also, the browser is not sending an `If-Modified-Since` header for any resources related to loading an XForms document.
>
> Is something wrong with the way that XForms is doing caching of retrieved resources?  Is anyone else seeing behaviour such as this?  Should I file a bug about this?
>
> Thanks,
>
>     John L. Clark
>
> ===================================
>
> Cleveland Clinic is ranked one of the top hospitals
> in America by U.S. News & World Report (2007).  
> Visit us online at http://www.clevelandclinic.org for
> a complete listing of our services, staff and
> locations.
>
>
> Confidentiality Note:  This message is intended for use
> only by the individual or entity to which it is addressed
> and may contain information that is privileged,
> confidential, and exempt from disclosure under applicable
> law.  If the reader of this message is not the intended
> recipient or the employee or agent responsible for
> delivering the message to the intended recipient, you are
> hereby notified that any dissemination, distribution or
> copying of this communication is strictly prohibited.  If
> you have received this communication in error,  please
> contact the sender immediately and destroy the material in
> its entirety, whether electronic or hard copy.  Thank you.
>
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms