it's a great practice - i tend to do it on a few pages where there are
possible ajax queries like tooltips / stock checks etc that can be
cached. however, i have not done this as a class that extends
request,I simply store the response into the element for future use or
into my data array, checking against either before making a new
Request instance.

I think your approach can be much more generic and powerful - i'd do
it by adding an option to the request class cachable: false and on
true in the constructor, id' store the response and only retrieve it
in any future instances that match the same parameters.

you may want to set things like cache TTL and a method that clears
cache / forces a new fetch. please post your work when done :D

Reply via email to