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

API Caching #136

Closed
adriancollier opened this issue Jan 8, 2013 · 7 comments
Closed

API Caching #136

adriancollier opened this issue Jan 8, 2013 · 7 comments

Comments

@adriancollier
Copy link
Contributor

We are currently utilising the API resource for generating pins for the Global Project maps and project page maps.

The process to collect all the data required for the maps take some time and has caused server issues during the previous release.

We have implemented a part-solution to collect the points on the map in 100 intervals, allowing the server to respond more effectively. But the process still takes too long to completely populate.

We need to investigate and implement a Caching solution for the API data returned for the maps. This solution should collect and store the data set being called for, to allow faster access to the web server when requested.

  • The API Call being used for the maps should be run regularly
  • The cached data should be stored and made available to Apache.
  • Apache should retrieve the cached data on request
  • In the event that the data is already stale, a new call should be made to the API
  • The new data should replace the existing cached resource
  • Subsequent calls should collect the latest cached data

In the event that this solution is effective then it should be ported also to the homepage to replace the image that is currently present.

Any solution that has been found that covers these requirements should be presented as following:

  • Outline of solution
  • Process flow for map users
  • Additional libraries/resources to be used
  • Notable dependencies
  • Drawbacks or issues
  • Estimation of implementation time
  • Test case
@ghost ghost assigned zzgvh Jan 8, 2013
zzgvh added a commit that referenced this issue Jan 9, 2013
zzgvh added a commit that referenced this issue Jan 15, 2013
Rewrite convoluted resource name lookup for map template tag, needs
refactoring some day tho...

Make all jQuery calls to the API cachable.

Remove un-needed map ID parameter in map tempalte tag.

Fixes to google maps options.

Formatting fixes.
osg74 pushed a commit that referenced this issue Feb 18, 2013
…ments.

Added dependent pip packages for building the Celery package.
Added package version numbers as required.
@adriancollier
Copy link
Contributor Author

API Caching solution for Map calls - to be Code-Checked by @peeb

@adriancollier
Copy link
Contributor Author

@zzgvh - did we implement the Caching solution for the API?

If so, can you confirm it's working correctly?

@adriancollier
Copy link
Contributor Author

@zzgvh am I correct that what was implemented for this previously has been removed due to issues?

@zzgvh
Copy link
Contributor

zzgvh commented Jun 20, 2013

Caching is currently running on live using a customized version of django-cacheback. However even if it's very elegant in a way, the coding needed for it to integrate into tastypie is ugly and brittle since I had to rewrite a couple of the internal methods. It has already broken once due to internal changes in tastypie. So I'd like to back out of this experiment and go back to a memcached-based solution for the short term, and look at using varnish (for the whole site) in the longer term.

zzgvh added a commit that referenced this issue Jun 20, 2013
Use SimpleCache to add memcached-based caching to OrganisationMap and
ProjectMap resources.
@adriancollier
Copy link
Contributor Author

@zzgvh could you give a brief update on what we still need to do, and at that point we need to decide which Milestone/Release to put this into.

@zzgvh
Copy link
Contributor

zzgvh commented Jul 3, 2013

Having dug deeper in the Tastypie code I find that the caching for the maps resources works as intended. Unfortunately that means that only individual objets are cached, that is all Tastypie provides, so the calls we're making to populate the global maps are never cached 😞

I suggest we close this for now and implement Varnish ASAP. The live server seems to hold up fairly well as it is.

@ghost ghost assigned zzgvh Jul 3, 2013
@adriancollier
Copy link
Contributor Author

Agreed - I'll create a new Varnish issue based on the above requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants