1) If the page is not updated frequently, obviously the first method is more convenient 2) The memory limit of memcache depends on your physical machine, but there are some usage scenarios of memcache that need to be paid attention to, which may cause performance degradation 3) Memcache saves keys Value data, for Django, is that the HttpResponse corresponding to each URL is cached. The previous process is 1) Django view obtains data from DB through Models 2) Then calls template to render to form a real HttpResponse 3) Pass Http Socket writes the data back to the client With memcache, the above 1 and 2 are omitted. The saved HttpResponse is directly taken out from the cache pool according to the URL and returned to the client
1) If the page is not updated frequently, obviously the first method is more convenient
2) The memory limit of memcache depends on your physical machine, but there are some usage scenarios of memcache that need to be paid attention to, which may cause performance degradation
3) Memcache saves keys Value data, for Django, is that the HttpResponse corresponding to each URL is cached. The previous process is
1) Django view obtains data from DB through Models
2) Then calls template to render to form a real HttpResponse
3) Pass Http Socket writes the data back to the client
With memcache, the above 1 and 2 are omitted. The saved HttpResponse is directly taken out from the cache pool according to the URL and returned to the client
Like it, although I have never used cache in django.
But I still want to say that this is the correct idea and format for asking questions.