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
Rename add()? #1
Comments
Nothing should be 'magic'. Given the 2.5MB limit, a programmer should know that things are being added on top of existing resources for the same domain. So, if you have a jquery-1.5.min.js and then a jquery-1.8.min.js, it should be known that it is added and not replaced, or the resource-management is automagically managed. |
But if it's doing its job, it's not being add()ed with every call; whereas |
I see, perhaps there should be another function, that merely adds? and then the load execs the add if it doesn't exist? A function should ideally be isolated to a singular task. |
Maybe a separate add(), especially as Mike Taylor and I proposed a remove() elsewhere. Perhaps implemented as an "eval" |
In this context I'd like to add my 2 cents: if this pattern becomes popular a plug in for require.js and others could do the job about API names. |
In my view, this use of localstorage is not conducive, and efforts should be made to make the appCache better as it is dedicated for caching. I assert localStorage is best used with data (e.g. to-do lists, map points, svg paths(?)) not for resource caching. |
AppCache unfortunately has a number of pain points at present. I think On Fri, Mar 2, 2012 at 7:55 PM, Divya Manian <
|
I agree that a more succinct API would be preferable here. Perhaps:
would cover all our needs. In terms of @nimbupani's comments regarding localStorage usage here, I have to say that I'm personally still on the fence about this approach. I've read Google, Bing and Facebook engineers say that there are definitely performance benefits to storing scripts in this manner (despite localStorage not (at least in my view) having been created for this purpose). What I would like this project to do is:
+1 to @mahemoff. This is really just a hack until the alternatives improve. |
I've revised the API to meet the above in the latest version. I'll be tweaking this further to cover a few more capabilities soon, but closing this issue for now. |
update basket.js
I'd suggest load() or require() is more appropriate, since that's what the programmer is trying to achieve. That it's add()ed to the cache is the magic this library is making invisible.
/nitpick
The text was updated successfully, but these errors were encountered: