YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Broken Submissions Solution - Web Development

Get Embed Code
2 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. Obviously if there are multiple good answers in here, don't
  2. cache isn't the solution and given that this is the content
  3. of our lecture, we're going to continue with our caching. So, let's
  4. look at these other three. Improve the cache to automatically expire
  5. after some time. I'm not going to count this as correct. Although
  6. it is possible. And actually many caches, and the, the, the
  7. main cache we'll be talking about shortly, has this ability. But
  8. that doesn't solve our problem here, because if things automatically disappear
  9. out of the cache after some amount of time, there's no
  10. guarantee that that's going to coincide with our submission time. So
  11. let's look at the other answer, after submitting, clear the cache.
  12. Yes. This will work. This basically restores the cache to the
  13. state that it was in before we did a request. So
  14. you submit some art. We store it in the database, and
  15. then we blank the cache, and then the next page load
  16. clears the cache. Another answer after submitting, update the cache. This also
  17. works, but it makes things more complicated. So,
  18. in other words, after submitting a piece of art,
  19. we update the database, and we immediately update
  20. the cache at the same time so that the
  21. next page load of the front page has
  22. an updated version of the art. This would work,
  23. but it's, it's more complex, so let's start with
  24. the first solution after we submit clear the cache.