launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #02811
How to force browser reload from portlet? (Bug #471195)
In bug #471195 ("private bugs don't set body class to 'private'"), I've
linked a branch that contains the underlying code fix (basically gmb's
patch from the bug, plus tweaks based on advice from Tim Penhey).
However there is still a problem, I think caused by browser caching.
Compare the "<body>" tag situation in branch vs bug:
For the branch case: in your development instance visit branch
https://code.launchpad.dev/~name12/firefox/main. To toggle between
public and private, click on "Change branch details", then check or
uncheck a privacy checkbox, then hit submit to be brought back to the
main branch page. The "<body>" tag's "class" attribute will say
"public" or "private" correctly every time. There are no browser
caching issues because you're going from the "Change details" page back
to a fresh load of the branch page.
Now consider the bug case. The toggling is done directly on the page,
via a portlet. After you toggle public<->private, the "<body>" tag
class may not be updated -- but if you hard-reload the page, the class
will be updated correctly, as expected.
Tim instantly said "browser caching issue", and that makes sense to me.
Is the solution some javascript triggered to reload the page when the
portlet is toggled? I feel like that's the way to go, and ISTR Deryck
saying that when he pointed me at the bug too.
Since it's late in NY now, and many of the people who can answer this
question are in EU/UK time zones :-), I thought I'd post the question
here, to save me time rediscovering the wheel. If anyone knows some
good example code for this situation, please throw my way.
-K
Follow ups