Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some helpful info to Wiki #17

Open
jgulledge19 opened this issue Sep 9, 2014 · 1 comment
Open

Add some helpful info to Wiki #17

jgulledge19 opened this issue Sep 9, 2014 · 1 comment

Comments

@jgulledge19
Copy link

I wrote these out as I just set this up, could help others. Thanks,

Where to begin with statcache and overview of the setup process.

  1. Install via Package Manager
  2. Go to the plugin and attach the correct System events: https://github.com/opengeek/statcache/wiki/StaticCache-Plugin
  3. There are no system settings just Properties to configure statecache: http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/properties-and-property-sets#PropertiesandPropertySets-AssigningPropertySetstoElements
  4. Now clear cache and go to a few pages that are cachable. Note if using default settings there must not be any none cachable snippets/chunks/placeholders on the page. ex: [[!mySnippet]]
  5. Check the statcache directory at the root of your MODX install for files that are written to this folder. If the folder does not exist, create it and make sure PHP can write and modify it. statcache is the default directory.##Now you are ready to add to the .htaccess rules
  6. If you are using urls without the .html then you will need to add an .htaccess file to your
    statcache directory. Review: https://github.com/opengeek/statcache/wiki#web-server-configuration-issues for complete details
  7. If you are running on NGINX review: https://github.com/opengeek/statcache/wiki#web-server-configuration-for-nginx
  8. If you are running on Apache
    • Open up your .htaccess file that does your MODX friendly URLs. This is most likely in the root of your MODX install.
    • Add the appropriate rules just before the MODX SEF, those will look like this:
# Add statcache rules Here

# END statcache
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Review rules: https://github.com/opengeek/statcache/wiki#web-server-configuration-for-apache
Rewrite cheat sheet: http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html
RewriteCond cheat sheet: http://www.askapache.com/htaccess/rewritecond-cheatsheet.html

500 errors, if you have cPanel then go to Logs -> Error Log and there may be a message in there.
Note I did not get the rules in wiki to work with my shared hosting that runs on apache. Here is what I ended up writing:

# Start statcache
RewriteCond %{DOCUMENT_ROOT}/statcache/%{REQUEST_URI}~index.html -f
RewriteRule ^(.*)$ statcache%{REQUEST_URI}~index.html [L,QSA]

RewriteCond %{DOCUMENT_ROOT}/statcache%{REQUEST_URI} -f
RewriteRule ^(.*)$ statcache%{REQUEST_URI} [L,QSA]
# END statcache
@ysanmiguel
Copy link

Great, Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants