Use an asynchronous server
Servers (web, applications, etc.) such as Nginx, node.js and Gawn are designed to use the as few resources as possible. As they work asynchronously, they do not need to create a process or thread for each new request. Therefore, they do not waste their resources.
While most web servers increase their RAM consumption as they receive requests, asynchronous serves remain stable.
Cache objects repeatedly accessed by JavaScript
Accessing the DOM (Document Object Model) drains processor resources (CPU). Therefore, when you reference the same DOM element several times in JavaScript, store its reference within a variable to avoid re-parsing the DOM for the same element.