How specific does the directory location need to be for LoadFromFile?

50 views
Skip to first unread message

Viktor N.

unread,
Oct 7, 2021, 4:11:18 PM10/7/21
to ngx-pagespeed-discuss
Hey guys,

Just a quick question. When using LoadFromFile, how specific do I have to be with the directory location?

Is the webroot location enough for pagespeed to figure out where static resources are? Or should I specify the exact directory where the files are stored?

For example, using WordPress directory structure to load images, which option would work?


Option 1 directory location (webroot): "/home/user/public_html/"
Option 2 uploads directory: "/home/user/public_html/wp-content/uploads/"

Would appreciate your feedback. Thanks a lot!

Longinos

unread,
Oct 8, 2021, 3:19:25 PM10/8/21
to ngx-pagespeed-discuss
Hi
With Option 1, all static resources from the WP installacion can be loaded from file, not only images but css and js files
With Option 2 only files in wp-content/uploads/ (and recursive subfolders) can be loaded.

So, if you configure pagespeed to only optimize images, option 2 is ok, but if you configure it to optimize css and js files, better use option 1.
Reply all
Reply to author
Forward
0 new messages