Bug 38723 - BXE edits not reflected when one saves with BXE
Summary: BXE edits not reflected when one saves with BXE
Status: RESOLVED FIXED
Alias: None
Product: Lenya
Classification: Unclassified
Component: Bitflux Integration (show other bugs)
Version: 2.0
Hardware: Other other
: P2 normal
Target Milestone: 2.0
Assignee: Lenya Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-20 18:58 UTC by renaud richardet
Modified: 2007-07-16 01:58 UTC (History)
0 users



Attachments
disables browser and proxy caching in the authoring area, so that users see their changes immediately. (760 bytes, patch)
2006-05-19 12:25 UTC, J
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description renaud richardet 2006-02-20 18:58:32 UTC
Reproduce:
- edit a document with BXE
- save&exit
- the changes are not reflected on the document

Thanks for a hint, Renaud
Comment 1 Doug Chestnut 2006-02-20 19:02:23 UTC
Page is most likely being cached by your browser, try refreshing.  We should set
the cache control for the authoring area to not cache.  I have noticed this too
since the last modified date was formated properly.  This is good for the live
area, not so good for authoring.
Comment 2 renaud richardet 2006-02-20 22:48:34 UTC
Thanks Doug,

This is a caching problem indeed (refreshing the page did the trick). BTW
Oneform works without refreshing.

It is very strange, because I cannot reproduce this bug every time...

> We should set the cache control for the authoring area to not cache.
Yes, makes sense. I am not sure where to do that, so that it affects the
authoring area only. I guess you are thinking about the publication sitemap,
because all pipelines in the sitemap.xmap of the BXE module are of type noncaching. 
Comment 3 Doug Chestnut 2006-02-20 23:22:21 UTC
(In reply to comment #2)
> Thanks Doug,
> 
> This is a caching problem indeed (refreshing the page did the trick). BTW
> Oneform works without refreshing.
> 
> It is very strange, because I cannot reproduce this bug every time...
> 
> > We should set the cache control for the authoring area to not cache.
> Yes, makes sense. I am not sure where to do that, so that it affects the
> authoring area only. I guess you are thinking about the publication sitemap,
> because all pipelines in the sitemap.xmap of the BXE module are of type
noncaching. 

Caching needs to be disabled in the response headers or in the <head> for
documents accessed in the authoring area.  I don't believe that the sitemaps are
caching, just the browser (client side caching).
Comment 4 renaud richardet 2006-02-22 01:17:28 UTC
Isn't it already done within the publication sitemap?         
 <map:act type="set-header">
   <map:parameter name="Last-Modified"
value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" />
Comment 5 Doug Chestnut 2006-02-22 03:27:03 UTC
(In reply to comment #4)
> Isn't it already done within the publication sitemap?         
>  <map:act type="set-header">
>    <map:parameter name="Last-Modified"
> value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" />
> 

actually, I think that the addition of this header (correct formatting) is when
I started to notice the browser caching.  Anyway, I added a Cache-Control:
no-cache header to documents served from the authoring area (default pub
sitemap).  It seems to have resolved my caching problems, please test ;)
Comment 6 Josias Thoeny 2006-02-22 10:17:27 UTC
Found out now that a web browser calculates an expiry-time for a web page, using
the last modified date (if present). If a document has not expired, the browser
will not reload it from the server.
(See http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html)

The heuristic algorithm is something like
expires = now + (date header - last modified header) / 10

This explains why the problem started when the last modified header was set
correctly, and also why it only happened sometimes (when the last-modified date
was "old").

So Doug's solution seems to be the right one, and it worked in my tests.

Comment 7 J 2006-05-19 08:34:51 UTC
what's the cleanest way to overcome this problem? my current approach is to add
some cache-control meta tags to src/webapp/lenya/xslt/menu/menu2xslt.xsl (see
attached patch). i believe this is the correct way to do it.

please review and, if it's ok, apply asap, since the current situation is
absolutely mystifying to users :-D

Comment 8 J 2006-05-19 12:25:43 UTC
Created attachment 18322 [details]
disables browser and proxy caching in the authoring area, so that users see their changes immediately.
Comment 9 J 2006-05-24 19:28:05 UTC
it appears that the meta tags for cache control will not disable caching in
firefox in all cases: when leaving an editor or creating a new document, the
changes are visible immediately, but when you submit or publish etc., the
browser still caches and you don't see the current workflow state until after a
reload.

i suspect that if you select http 1.1 support, firefox expects 1.1 conformant
cache-control headers.

after adding the following action to my publication sitemap, firefox no longer
caches:
<map:act type="set-header">
  <map:parameter name="Cache-Control" value="no-cache" />
</map:act>

the question is: where do i add this in a clean way? i tried to find a global
sitemap matcher that handles all requests in the authoring area, but couldn't
find one. please help!
Comment 10 Andreas Hartmann 2006-06-07 15:42:35 UTC
AFAIK there is no specific "authoring" pipeline. But you could use a
ParameterSelector to check for {page-envelope:area} and invoke the action only
if the area is "authoring".
Comment 11 J 2006-06-07 16:27:29 UTC
(In reply to comment #10)
> AFAIK there is no specific "authoring" pipeline. But you could use a
> ParameterSelector to check for {page-envelope:area} and invoke the action only
> if the area is "authoring".

sorry, it appears that this bug has been fixed a while ago:
http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/sitemap.xmap?revision=379396&view=markup
i had not synced my custom sitemap to the trunk...
this fix solves the problem for me. sorry for the noise.

btw: the fix is in a part of the pipeline that is actually specific to the
authoring area.
Comment 12 Andreas Hartmann 2006-06-08 08:04:37 UTC
(In reply to comment #11)

[...]

> btw: the fix is in a part of the pipeline that is actually specific to the
> authoring area.

Yes, because it's applied to the default publication's sitemap. The fix won't
work in other publications, unless they use the default pub as a template :(
Comment 13 J 2006-06-08 17:27:48 UTC
(In reply to comment #12)
> Yes, because it's applied to the default publication's sitemap. The fix won't
> work in other publications, unless they use the default pub as a template :(

true. we need to move more functionality out of the default template and into
the core, but i think for now the recommended practice should be to sync one's
custom sitemaps with the default one regularly, so as not to miss important
fixes (which happened to me in the case of this bug). i have since taken to
maintaining my own sitemap as a diff against the default one.
Comment 14 Thorsten Scherler 2007-07-16 01:58:58 UTC
Renaming Lenya 1.4 to 2.0