Support » Plugin: User Access Manager » UAM makes serving images horribly slow

  • Hi folks,

    I have been playing around with UAM a lot now, as it seems to be the only plugin around which not only is able to limit the access to posts and pages but also to files which is important if you want to have an “internal” section on your web.

    I have experienced some problems with UAM regarding performance. There have been a lot of posts here regarding performance, but no real solution nor an update seems to have fixed that. I notice drastic performance impact when enabling file locking for image files.

    My web site makes quite heavy use of pictures: I’ve got a slider with several images, as well as four mini-sliders, some large thumbnails and so on at the home page. All that loads fairly fast when disabling UAM completely or when I enable UAM but keep file locking disabled. On a page without pictures enabling UAM adds around 300ms to the page loading which is a lot but still OK for me, but if the page contains pictures and UAM is set to lock files, it takes forever: images appear after several seconds which is not viable.

    I have worked around this issue by disabling file locking for all types of image files. That worked well since I had permalinks disabled. Now I found a solution to get UAM working with permalinks (and yes, I do want to use permalinks) under, I am back with my original problem: images server horribly slow! As I cannot turn off file locking for some types of files only when permalinks are enabled, I can just switch file locking ON or OFF, so I can decide to have some pages and posts protected but not the documents linked in these pages (which is very bad) or to not use permalinks at all (also bad).

    Have any of you found a solution to that? Is there a way to hack UAM to not lock certain file types and to serve them without checking and adding huge load times?

    I am looking forward very much for some helpful replies.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    I have been having major issues with this as well. I think the problem lies in that all the files in the uploads directory are being passed through the .htaccess redirect, and this is preventing cacheing. If it’s possible to create a folder in the media area only for locked files, and put the .htaccess that checks locks in that folder only it seems like the rest of the images could be cached as normal. I am going to try using a combination of this plugin and a Media Manager plugin that allows for the use of different folders to see if I can achieve faster loading. I’ll check back in to let you know how it goes!

    The method showMediaFile would suggest that media files are dealt with by being read by the plugin and then output (as a result of the .htaccess redirect), which is inevitably going to be slower than being directly read by the web server itself.

    Plugin Author GM_Alex


    Yes that is the reason, but I have no other idea to protect the files in an other way. Maybe somebody else has any suggestions?

    We have a solution which works if you are not bothered about locking images (or certain files by extension). In our case we only want to lock uploaded documents like pdf, zip, doc etc.

    You can let apache serve the images by bypassing the protection for these, as follows.

    1) Edit the plugin manually (there are no hooks) to change how it writes out the .htaccess file
    2) Edit the generated htaccess file (in the uploads folder) (WARNING – this will be overwritten if settings are saved)

    You need the following line (or similar) in your .htaccess

    RewriteRule .*\.(jpg|png|gif|jpeg|bmp)$ - [L]

    Just before the last line which routes everything into the plugin controller.

    Digital Acorn Ltd

    Hi, seeing your post it reminded me to report back. By using the Media Manager to create different folders to keep locked files in, and moving the generated .htaccess rules to those folders instead (have to make sure paths are correct) I was able to get it working like I wanted. It would be good to see a note about slow page serving in the option to lock files; it took me a long time to figure out that this was the cause of my problems. Or options to implement some of these workarounds in the next version. At any rate, thanks for putting out the plugin!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘UAM makes serving images horribly slow’ is closed to new replies.