I noticed that when I load the page, in my developer’s console I write to the card with the extension ".jpg" - type: text / html, and because of this, for each page rheologue - it requests it from the server, and it comes with status 200, instead 304. And there is extra traffic.

.Htaccess file

AddDefaultCharset utf-8 DirectoryIndex index.php RewriteEngine On # не позволять httpd отдавать файлы, начинающиеся с точки (.htaccess, .svn, .git и прочие) RedirectMatch 403 /\..*$ # если директория или файл существуют, использовать их напрямую RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # иначе отправлять запрос на файл index.php RewriteRule . index.php 

As you can see, there is nothing in the file (in my opinion) that makes you define it with such an extension as text / html.

Question: How can .htaccess, or in other ways forcefully set the type for .jpg (and other extensions) to the desired type?

    1 answer 1

    Add to .htaccess

     AddType image/jpeg .jpeg .jpg .jpe