php - How to store a javascript widget which has analytics? Dynamic or static? -


i have widget provide boot loader put on website. bootloader file gets settings widget , creates widget. content of bootloader file doesn't change unless widget edited, means of times bootloader file has static content.

however right bootloader file created dynamically every request. save settings widget in database , serve file. size of file 6kb. wondering better: save data in database , serve bootloader file dynamically, save data in static javascript file or store data in database , store data in javascript file (this allows later updates in corrupted javascript files)

also, wondered if stored static js file .js.gz (compressed) , .js(uncompressed) how serve uncompressed file when browser not support compressed file...could same done if dynamic bootloader file used.

the bootloader file used json content processed bootloader file , displayed, means bootloader file better if cached prevent getting js on , on again.

so ->how should file stored? ->how difference in speed? ->any other advice? 

i think better of storing file javascript , keeping copy of in database backup purposes. serving a static javascript can as 10 times faster....also, mean cpu working less hard.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -