Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Server-side Caching #34
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I worked on this last night but I realized I made it too simple & it's only a file system cache. It doesn't take into account that your output will change based on new browsers. I'll continue to work on it.
At the end of the day I'm not really sure it's going to improve all that much. It seems like a better option would be to store data on the client. For any particular user-agent if they failed once they'll always fail. The only thing that will change from their perspective is the list of browsers that are compatible with the feature they want to support. And those browsers don't come out every day.
It might make more sense to push the content retrieved via JS from your API into a cookie w/ a short time out (say 12 hours) so that your API only gets hit twice a day for a particular client. Something similar could be done for server-side clients using your service. For example, I'd love to integrate your API with my project, Detector, but there's no need to request data from you guys on every page request. I don't see why the Modernizr plugin couldn't be upgraded to check the availability of a cookie first. It can work similar to the server-side cache.
If that's of interest I can address the client-side issue too.