So I've had the same problem as a lot of people, youtube was extremely laggy even when I played 240p videos and I tried everything, html5 youtube, flash-aid plugin for firefox and whatnot, and they didn't work for me.
Then I enabled "Override automatic cache management" on firefox. It got a little better but still a bit laggy on fullscreen.
Then I thought I'd let Ubuntu use more cache . So if you have the same problem just try this:
sudo gedit /etc/apt/apt.conf.d/70debconf.
Then put this code,:
on that file and then save it.
Next type this code on your terminal
sudo apt-get clean && sudo apt-get update --fix-missing
and you won’t find apt cache limit again in the next time.
It worked for me!!!