大家好,请教一下,下面这段django cache 的后面的else逻辑是怎么实现的
given a URL, try finding that page in the cache
if the page is in the cache:
return the cached page
else:
generate the page
save the generated page in the cache (for next time)
return the generated page
就是我现在第一个页面有有需要用户填的表单,填完之后,有个预览的按钮,跳转到预览页面之后,我想再通过一个按钮返回第一个页面,那么是否可以用上面的这个逻辑来实现?要怎样进行页面的cache保存与返回 呢?
given a URL, try finding that page in the cache
if the page is in the cache:
return the cached page
else:
generate the page
save the generated page in the cache (for next time)
return the generated page
就是我现在第一个页面有有需要用户填的表单,填完之后,有个预览的按钮,跳转到预览页面之后,我想再通过一个按钮返回第一个页面,那么是否可以用上面的这个逻辑来实现?要怎样进行页面的cache保存与返回 呢?