What is a static file? What does it mean "to serve static files"?
5 Answers
The opposite of a dynamic file :) It means that the file content will be sent to the client (usually a browser) as is without server intervention. By contrast, a dynamic file is parsed by the server which then renders a new set of data based on the dynamic file template. A dynamic file will typically use some form of server-side code to let the server know what type of modifications need to be made.

- 35,165
- 3
- 73
- 81
A static file is something like:
index.html
style.css
script.js
image.jpg
Basically, anything which is not a PHP script, and anything which is not dynamically generated by your web server.

- 13,017
- 5
- 57
- 70
It's a file that doesn't change. There isn't any logic running to generate what you see as there would be on a page with "dynamic" content.

- 2,837
- 15
- 15
It means that server will not be used to produce a file.
When you ask for a *.css or an image - the server does not intervene, whereas if you ask for *.php file a server needs to generate it before giving it back.

- 214,103
- 147
- 703
- 753
When people talk about static/dynamic files, they talk about how the file is GENERATED.
A file like index.html
can be a "dynamic" file, in a sense that it is dynamically GENERATED (using a server which reached out to a database, some API, some code etc.)

- 1,646
- 2
- 17
- 36