Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's difference between static and non-static resources?

I am primarily a front-end developer/designer, however recently, I've been exploring end to end solutions. Yesterday I finished a TODO application using the mean stack and would like to start exploring deployment options to my VPS.

That being said, I've been advised to use nginx as a reverse proxy is for serving up static resources? Unfortunately, I'm getting stuck on simple questions.

What are the example static resource?

What factors define static resources?

What are examples of non-static resources?

Lastly, are there any weird edge-cases I should be aware of?

Sorry about the noobness of this question.

like image 979
Armeen Harwood Avatar asked Jun 08 '14 17:06

Armeen Harwood


1 Answers

In this case, a static resource refers to one that is not generated with code on the fly, meaning that its contents won't change from request to request.

Images, JavaScript, CSS, etc., are all candidates for this. Basically, you set a large cache time for these resources, and your Nginx servers can keep a copy on disk (or in Redis or something similar) so that they are ready to return to the client without hitting your application servers.

It's important to remember to use versioned file names when setting large cache times. header-image-20140608.png for example, means you can have a later version without worrying about the old one still being in the cache.

like image 164
Brad Avatar answered Oct 04 '22 02:10

Brad