search

Home  >  Q&A  >  body text

python - 在django中使用缓存来加速(memcached)困惑?

ringa_leeringa_lee2811 days ago640

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:05:28

    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

    reply
    0
  • 阿神

    阿神2017-04-18 10:05:28

    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.

    reply
    0
  • Cancelreply