SpaceApi-archive / endpoint-hosting

Easily create a new endpoint in one minute!
http://spaceapi.net/new
0 stars 0 forks source link

HTTP Cache #1

Open tasomaniac opened 10 years ago

tasomaniac commented 10 years ago

Sorry if I post in the wrong place. The directory listing is not changing much. So why not you guys add basic HTTP cache. That will improve your server speed as well as the speed in the clients.

slopjong commented 10 years ago

If you mean the resource directory.json, this is updated once per day. If I introduce an ETag new hackerspaces possibly don't see their endpoint in the list until the lifetime has exceeded, this happens only if they loaded the directory before of course.

If you mean the generated json by the endpoint scripts it doesn't make sense to cache if real-time sensor data are exposed to the public.

I guess you mean the first case. What app are you using which slows you down? At the moment apps should cache the directory themselves for an appropriate time, I wouldn't get unnecessary bug reports because people don't see their endpoint after adding it to the directory.

The behaviour will change in the future, code improvements are planned but also new features related to the cache. I'll probably introduce the ETag for general client-side caching and a nocache parameter for those who need to temporarily buypass it.

slopjong commented 10 years ago

The first time I replied via email but they don't parse markdown then :-1:

tasomaniac commented 10 years ago

I mean the directory json. I am working on a project that I use the spaceapi.

Actually it is not slow at all. It is very fast. Modern browsers and httplibraries use httpcaching very well. If you do it, the apps will only get the header and then if it is updated they will get the actual data. It is very easy I guess and it is an improvement.

Manual caching of the list in the client applications is a burden I think. It can introduce problems and not very easy at all. There will be lots of boilerplate code. On Mar 23, 2014 9:56 AM, "Romain Schmitz" notifications@github.com wrote:

The first time I replied via email but they don't parse markdown then [image: :-1:]

— Reply to this email directly or view it on GitHubhttps://github.com/SpaceApi/endpoint-hosting/issues/1#issuecomment-38376441 .