Is it possible to cache a dynamic webpage if javascript is used to alter the display or write new innerHTML into the page. For example maybe some ajax runs and fetches some info from the database that is then displayed dynamically on the page by rewriting the innerHTML of a div.
Is it possible to cache the final html and serve that up instead of recreating it each time.
Thanks,
Dan
Yes, of course.
It is common with auto-complete text input boxes to cache the results so that hitting backspace or delete does not re-send requests to the server.
How to do it? Just read
innerHTMLfrom the DOM tree and save somewhere, in a JavaScript variable or even in HTML5 local storage.