Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle resources other than JavaScript #84

Merged
merged 2 commits into from Sep 1, 2013

Conversation

wibblymat
Copy link
Collaborator

Work in progress. Don't merge yet.

This doesn't quite close #77 because I didn't implement the live parameter that I describe in the doc.
It also doesn't fix #76 or #60 because there is no example CSS handler or any documentation.

I think this is the meat of the implementation though, so please sanity check the work so far.

@peol
Copy link
Collaborator

peol commented Aug 12, 2013

Looks good to me, great work so far!

@addyosmani
Copy link
Owner

Whoa! We were not expecting to see this so soon. Great work, @wibblymat 🍰

@addyosmani
Copy link
Owner

Re-reading through the proposal, (forgive me ignorance) but I couldn't fully understand the use case for caching the result, but always fetching live. Is the idea that some other process may consume the cached data but the loader in that scenario just cares about always fetching latest regardless?

@wibblymat
Copy link
Collaborator Author

It's for use by web apps that may be offline. In the example of a Twitter client, let's say that in the morning I go fetch your tweets while online. Later on I'm on the tube and go back to get your tweets. I can't get a live version, but I can get it from the cache and show a message letting the user know that the data is not fresh.

This requires that the data is cached, so it goes through basket and we want to cache for a longish time (a week maybe). But when we have connection we want to get the latest, and update the cache with that.

Does that make sense?

The logic should probably be:

  • live is false
    • behave as now, returning from the cache if possible, over the network otherwise.
  • live is true and can't fetch (timeout or navigator.onLine === false, not just a 404)
    • return from cache if available, perhaps flag that the result is not live even though it was requested
  • live is true and network is available
    • fetch over the network and update the cache

@addyosmani
Copy link
Owner

Aha. Now that makes sense. Thanks for the explanation :)

@addyosmani
Copy link
Owner

👍

@addyosmani
Copy link
Owner

Spoke to @wibblymat about this yesterday. It looks like we should just need some docs changes and should be in a good position to land once those are written up. Great work once again!

@addyosmani
Copy link
Owner

Time to merge this baby! Let's handle docs as part of #85 💃

addyosmani added a commit that referenced this pull request Sep 1, 2013
Handle resources other than JavaScript
@addyosmani addyosmani merged commit c7fa593 into addyosmani:gh-pages Sep 1, 2013
@wibblymat wibblymat deleted the resource-handlers branch September 29, 2013 11:34
@andrewwakeling andrewwakeling mentioned this pull request Dec 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion of plugins for new resource types
3 participants