• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Issue NGINX Cache won't cache static files

forzasalva

New Pleskian
Server operating system version
AlmaLinux 9.5
Plesk version and microupdate number
Plesk Obsidian 18.0.65
Hi folks,

I have a problem with my NGINX proxy cache.

(Plesk Obsidian on AlmaLinux 9)

My settings are as follows in Plesk for the domain:

Proxy mode: on
Intelligent processing of static files: on
Serve static files directly through nginx: off

Cache size: 512MB
Time limit: 30 days
Key: $scheme$request_method$host$request_uri

My additional instructions:

set $no_cache 0;
proxy_cache_valid 200 30d;
proxy_cache_valid 404 10m;
proxy_cache_valid 206 30d;
add_header Cache-Control “public, max-age=2592000”;

The main domain is cached and the header also contains “HIT”.
Unfortunately, however, the static files (jpg, css, js, mp4, etc.) are not cached and “MISS” is constantly displayed.

What could be the reason for this?

Here is the nginx.conf generated by Plesk: NGINX Conf - PLesk - Pastebin.com
 

Attachments

  • maindomain-inspector.jpg
    maindomain-inspector.jpg
    16.9 KB · Views: 12
  • staticfiles.jpg
    staticfiles.jpg
    20.5 KB · Views: 13
Not that I know of.
This is the .htaccess file from WP:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^en/wp-login.php /wp-login.php [QSA,L]
RewriteRule ^de/wp-login.php /wp-login.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

The strange thing is that although the status of the X-Cache is MISS, the static contents are loaded from the ‘Memory Cache’ (according to the inspector).
The X-Cache header is as generated by Plesk. I have not entered any directives of my own.
If the static files are loaded from the ‘memory cache’, does this mean that the cache is active after all? Then I wonder why it always says ‘MISS’?
 
Thanks. How about in the /wp-content folder?

If the static files are loaded from the ‘memory cache’, does this mean that the cache is active after all? Then I wonder why it always says ‘MISS’?

As far as I am aware, this is in reference to the local browser cache rather than the server cache.
 
Back
Top