Closed
Bug 839682
Opened 13 years ago
Closed 13 years ago
Make socialapi-demo "reload the worker" button not load cached content
Categories
(Firefox Graveyard :: SocialAPI, defect)
Firefox Graveyard
SocialAPI
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: nalexander, Assigned: markh)
Details
This isn't the most detailed report, but: I configured a social provider served from localhost:5000 and started serving the socialapi-demo from https://github.com/mixedpuppy/socialapi-demo. I noticed my changes to `worker.js` were not being picked up by the "reload the worker" button; mixedpuppy suggested cache issues, and I think he's right.
I tested serving localhost:5000 with https://github.com/cloudhead/node-static configured with
cache-control: max-age=1
and "reload the worker" requests
15:9:31 [304]: /worker.js
15:9:31 [304]: /workerScript.js
15:9:32 [304]: //user.png
15:9:32 [304]: //statusPanel.html
15:9:32 [304]: //panel.css
15:9:32 [304]: //panel.js
with
cache-control: max-age=3600
I find that "reload the worker" requests nothing. This would be a lot more useful if reloading the worker didn't cache anything.
| Reporter | ||
Updated•13 years ago
|
Assignee: nobody → mhammond
| Assignee | ||
Comment 1•13 years ago
|
||
Playing devil's advocate here: The "reload the worker" feature was introduced mainly to solve reliability issues (eg, "worker got stuck somehow" or "worker is leaking") rather than as a tool providers could use while developing a provider. In this context, not using the cached version of the provider will mean a degraded experience for the user (ie, the reload will be far less seamless for the user when the code hasn't actually changed on the server).
Is documenting this fact a viable option? Then providers who are actually developing can either (a) arrange to serve more appropriate cache headers when developing (eg, include must-revalidate in the cache-control header) or (b) press ctrl+shift+delete to fairly quickly nuke the client cache when necessary?
Comment 2•13 years ago
|
||
(In reply to Mark Hammond (:markh) from comment #1)
> Is documenting this fact a viable option? Then providers who are actually
> developing can either (a) arrange to serve more appropriate cache headers
> when developing (eg, include must-revalidate in the cache-control header) or
> (b) press ctrl+shift+delete to fairly quickly nuke the client cache when
> necessary?
Makes sense to me. I think that's what we should do.
| Reporter | ||
Comment 3•13 years ago
|
||
(In reply to Mark Hammond (:markh) from comment #1)
> Playing devil's advocate here: The "reload the worker" feature was
> introduced mainly to solve reliability issues (eg, "worker got stuck
> somehow" or "worker is leaking") rather than as a tool providers could use
> while developing a provider. In this context, not using the cached version
> of the provider will mean a degraded experience for the user (ie, the reload
> will be far less seamless for the user when the code hasn't actually changed
> on the server).
>
> Is documenting this fact a viable option? Then providers who are actually
> developing can either (a) arrange to serve more appropriate cache headers
> when developing (eg, include must-revalidate in the cache-control header) or
> (b) press ctrl+shift+delete to fairly quickly nuke the client cache when
> necessary?
The thing that needs to be documented or made consistent is that 'reload sidebar' does *not* respect cache headers while 'reload worker' does. (Specifically max-age. I didn't try must-revalidate.) That threw me off. But I don't do much web dev; perhaps a more experienced web dev would expect this behaviour?
| Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #3)
> The thing that needs to be documented or made consistent is that 'reload
> sidebar' does *not* respect cache headers while 'reload worker' does.
> (Specifically max-age. I didn't try must-revalidate.) That threw me off.
> But I don't do much web dev; perhaps a more experienced web dev would expect
> this behaviour?
Yeah, the "reload sidebar" is exposed to the user and acts much like the reload button in the browser. "reload worker" is done completely differently for various reasons - in retrospect, we should have named the feature in the worker "restart worker".
| Reporter | ||
Comment 5•13 years ago
|
||
(In reply to Mark Hammond (:markh) from comment #4)
> (In reply to Nick Alexander :nalexander from comment #3)
> > The thing that needs to be documented or made consistent is that 'reload
> > sidebar' does *not* respect cache headers while 'reload worker' does.
> > (Specifically max-age. I didn't try must-revalidate.) That threw me off.
> > But I don't do much web dev; perhaps a more experienced web dev would expect
> > this behaviour?
>
> Yeah, the "reload sidebar" is exposed to the user and acts much like the
> reload button in the browser. "reload worker" is done completely
> differently for various reasons - in retrospect, we should have named the
> feature in the worker "restart worker".
That's a good explanation. I think both features are useful: "restart worker" is separate from the developer-oriented "reload worker". Probably not enough social provider developers to make it worth adding that functionality.
Comment 6•13 years ago
|
||
The frameworker reload is a reload, not a restart. We unload the iframe and reload it, completely resetting everything, and loading from the remote server (presumably based on cache settings). If I read the backlog here correctly, we're not having a problem with the worker reload, though the initial report indicates one.
The "reload sidebar" button in the demo provider is calling location.reload() within the sidebar, it is not the same as e.g. the reload context menu, and is not any part of socialapi code. This is not something to document as a part of the socialapi, it is just normal web stuff.
I'm not sure how location.reload works with the caching, if there is something happening that is not normal to location.reload, maybe there is some bug there. This was done prior to fixing the context menu to work with the sidebar. The context menu reload does a full reload of the service provider, using the same mechanism as the error page.
IMO there is nothing to document or change here outside of understanding why location.reload within the sidebar is not respecting cache headers. I have not had this problem with the node server for the demo provider. In the interim, using the reload context menu on the sidebar should do the right thing.
| Assignee | ||
Comment 7•13 years ago
|
||
Given the last few comments it seems there is nothing to do here...
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Updated•7 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•