There is a PHP-Apache site with pictures, access to which is given only to registered users. This prohibition is now implemented through the .htaccess file, where allowed IP addresses are added for the duration of the session.
Is there a better way to access these pictures? A variant with the generation of images through a script, or just the return of a file through a php script will probably be slow and heavy?