Does PHP increase the burden on servers to return image files? Is there a good way to protect private albums? I am a beginner in PHP and use ZendFramework. now I have a problem. to create an album, you can set it to not public. images are saved in the file system. my idea is, public images are placed in the public folder. anyone can browse them directly without php processing. If it is a user's private album, will the image url be controlled in the zend Framework and the content of the image file returned by PHP increase the burden on the server? Is there a good way to protect private albums?
I am a beginner in PHP and use Zend Framework. now I have a problem. I want to create an album,
It can be set to not public. images are saved in the file system,
My idea is that public images are placed in the public folder. anyone can browse them directly without php processing.
For a user's private album, the image url is under the control of the zend Framework and can be viewed only after I log on.
But the content of this image file needs to be dynamically returned using php? Will it increase the burden on many servers?
Is there any good way? Can mod_rewrite of apache be controlled?
------ Solution --------------------
Security generally sacrifices performance.
Php reading is a simple protection method.
You can choose to apply only to confidential files
Others are directly read using web server
------ Solution --------------------
So that users cannot directly access it.
No absolute confidentiality
It takes more time for users to pay attention to better password protection.
For example, limit the number of password retries
------ Solution --------------------
But the content of this image file needs to be dynamically returned using php? Will it increase the burden on many servers?
Yes. to dynamically return data, it will increase the workload to a certain extent, because it will occupy the memory for processing.
Is there any good way? Can mod_rewrite of apache be controlled?
Rewriting cannot be controlled. as long as you can see it in IE, you can still see it after rewriting. only the PHP output can be displayed in login verification!
You can see that CSDN's personal images are not protected!
------ Solution --------------------
Security is to sacrifice some performance, but these performance will not be very high.
Rewriting cannot solve the problem, because it cannot be judged. it is just a regular expression.
Use PHP to control the output of images. use PHP to determine whether to log on, whether to have permissions, and then output images. this is the logic. you can create a program based on this logic.