4 ms·
eval is not necessarily evil in this case indeed. However, it'll force you to make concessions in your Content Security Policy and probably not very good for ca
by wanda 10y ago
eval is not necessarily evil in this case indeed. However, it'll force you to make concessions in your Content Security Policy and probably not very good for caching.
- riskable 10y agoIf you're using eval() you can cache scripts wherever you want! I personally prefer IndexedDB but there's nothing stopping you from using localStorage or a even a service worker (with a little bit of cache trickery). Also, if you use a websocket you can pretty much forget about the content security restrictions. Websockets have no origin restrictions so you can load whatever you want from anywhere.