ruby on rails - How to cache an entire page save for one element -
i'm running e-commerce website , many pages dynamic widget displaying number of items in visitor's cart. want cache page yet retain dynamism. i'm considering caching fragments before , after widget wondering if there simpler way done.
edit: perhaps decided give cached page or not depending on whether cart empty or not start.
kindest of regards,
-- jack
one way have cart items displayed using javascript that's inserted after page loaded. can see on places stackoverflow login status gets injected page if wasn't cached. jquery can make pretty straightforward.
you can set number of items in cookie accessible javascript, not in session
hash that's not exposed client, , handle in document.onload
section.
Comments
Post a Comment