H
H
Hello America2018-11-05 14:34:15
Nginx
Hello America, 2018-11-05 14:34:15

What is the difference between static and dynamic WEB data, using the image in the attachment as an example?

In general, the question is simple, who is aware of the topic of processing by the Nginx and Apache server. I just need to understand the essence of dynamic data. Dynamic are POST and GET, static are photos, files or other uploaded data? But the HTML site pages are static, and the PHP file is dynamic?
339a612c14940c83a83bf8c245fadf97.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2018-11-06
@websofter

Yes and no
1. classic static jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi| wav|bmp|rtf|js|swf|flv|mp3
As a rule, these are physically available files.
BUT
As you understand, not all of these files are really static
, for example, .html can be part of the CNC, in which case you will not find this file on disk, since it is CNC
And of course it is better not to include it in the statics, or add an additional check that the file exists.
The same applies to sitemap.xml, which can be transferred by the CNC to sitemap.php
and even Robots.txt - but this is already a rarity.
Therefore, you need to do an additional check if the file is 404, then try to give it to Apache, and since this is a general rule for all special cases, then add it at the very beginning of the config.
Dynamics is what collects SMS, those urls that give 200 but these files are not on the disk.
By the way, the CNC itself checks whether there are physically such files.

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f    #  Если это не файл
  RewriteCond %{REQUEST_FILENAME} !-l     #  Если это не линка
  RewriteCond %{REQUEST_FILENAME} !-d    #   Если это не директория 
  RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$ # Защита от цикла
  RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]  # то перекинуть  в пхп ( в данном случае это битрикс)
</IfModule>

This is how the engine separates static and dynamic, I think this is the closest to the definition.
In this scenario, the physical php file is static, but if it is not there, it is dynamite.
If the .html file is static, if it is not there, then it is dynamics.

A
Andrey Shatokhin, 2018-11-05
@Sovigod

As you usually write in nginx, it will be divided. Usually statics are files on the screw.
php file is also static. But usually you don't need to give it, but you need the result of executing the php code in this file - and this is already a dynamic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question