Launchpad PPA Repos
TODO:
For Nginx
- [x] Create own launchpad repo for nginx with purge module as https://launchpad.net/~brianmercer/+archive/nginx doesn't support Ubuntu 13/14
- [x] Add nginx build with pagespeed module
- [x] Add http://wiki.nginx.org/HttpSubsModule
- [x] Add support for Lua
Below is my ngix compilation config when I was trying pagespeed
./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--user=www-data \
--group=www-data \
--without-http_ssi_module \
--without-http_scgi_module \
--without-http_uwsgi_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_ssl_module \
--with-http_gzip_static_module \
--with-http_spdy_module \
--with-http_realip_module \
--with-http_geoip_module \
--with-http_image_filter_module \
--with-http_sub_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_stub_status_module \
--with-debug \
--add-module=$HOME/ngx_pagespeed-release-1.6.29.5-beta
Hi, I am maintaining a repo and looking into including the pagespeed module as well. Having some issues building nginx with it right now but it already has the purge module. Pretty much just trying to modify the nginx repo to have it fit my needs: https://launchpad.net/~cloudingenium/+archive/nginx-stable. You can just copy it and work on your own or we could collaborate if you are interested.
@JCBauza thanks for stepping in and sorry for delayed reply. :-)
We will have a look at your repos soon.
Sometime back we got permission from https://launchpad.net/~brianmercer/+archive/nginx to use his codes as he may not add support for future Ubuntu releases.
@MiteshShah forked and tested sometime back - https://launchpad.net/~miteshshah/+archive/nginx
I also tested a local build with pagespeed successfully.
We will try to finish this by this month-end only.
We will update you soon. :-)
Who is state for pagespeed?
@tonibecker pagespeed is on the list. Most likely it will be there when this ticket will get complete.
@MiteshShah check https://github.com/wandenberg/nginx-selective-cache-purge-module/ - this might solve our problem of purging multiple variations of a URL
I like where Easy Engine is going but at least for me, I can't use it and risk a client site using an old abandoned nginx repository with security issues.
I'm guessing one of the hangups for Easy Engine—and your nginx helper plugin—is it needs the cache purge module compiled in. Keeping that up-to-date is a big job since it's a 3rd party module.
Mark Jaquith—one of WP's lead developers—wrote a post a few years ago on purging the cache with nginx (http://markjaquith.wordpress.com/2012/05/15/how-i-built-have-baby-need-stuff/) He's basically feeding nginx a specific header—pinged via WP—to invalidate the cache. AFAIK his method doesn't use any 3rd party modules, just some clever WP and nginx .conf trickery. Would be interested to hear what you think about his method. That would at least allow you to switch the ppa.
Seems to be great. Btw. Why aren't you recompiling the upstream Ubuntu Nginx package? plus add the cache purge and Mod page speed. Saves a lot of testing time, bug hunting etc.
P.s. please add also Ubuntu 14.04 LTS to your roadmap. PHP 5.5, Mysql 5.6 and Nginx with most features are standard in this release via Ubuntu upstream.
@RitterKnightCreative sending PHP headers to flush cache is bad idea. Many plugins send those kind of headers. Also, you can ignore cached version based on headers but to delete a single page from cache you will need to still compile nginx with cache-purge module.
@lisadebrij Compiling and hosting customized packages on launchpad is on list. That is why this ticket exist!
@rahul286 1. You do not have to respond with a !. There are several possible recompilings. From any Ubuntu source, from yourself, the neighbor, etc. This is a common question.
- Please provide the link to your launchpad url :)
@lisadebrij we cannot just take any launchpad repo.
We need to test it long enough on our production server first. Before that of-course test it on demo server.
Brain Mercer was actively maintaining repo - http://launchpad.net/~brianmercer and the way external repo can create issues (like outdated version, etc), we are willing to take long here but to come up with sustainable launchpad repos. We need them ourselves.
@MiteshShah is playing here - https://launchpad.net/~miteshshah
Once we are ready, we will maintain nginx repo actively at https://launchpad.net/~rtcamp
For MySQL 5.6 we have already decided to go with Percona (being used on our production server from almost 6 months)
Idea is not to fix problem in quick and dirty way but to have a long-term solution.
Also today only we came to know about new problem with Launchpad repos here - https://rtcamp.com/support/topic/error-unable-to-install-nginx-php5-mysql-postfix/ and here - https://github.com/rtCamp/easyengine/issues/192
We are already facing consequences of not testing enough here - https://github.com/rtCamp/easyengine/issues/184 (its day #4 and we did not even manage to reproduce issue).
So a serious tickets like this will really take time (atleast from our side).
If you are willing to build and maintain launchpad repo, we can speed this up. I already posted few comments on how nginx compile config should look like. We can discuss more about compile configs.
By the way the maintainer of http://launchpad.net/~brianmercer already gave permisison to take his work forwards as he has already decided to not update his repo for future nginx or ubuntu versions.
By the way, whenever we will have launchpad repo, we might put easyengine itself there as a package.
I guess ee update when switched to apt-get based update will prevent this error - https://github.com/rtCamp/easyengine/issues/179
@rahul286 : Care to expand on your comment about why invalidating a cache object via a custom http header is bad? I don't see a downside.
You're basically sending nginx your own "update the cache" header. Not sure you had a chance to fully read that whole thread but partway down the page Jaquith explains why he didn't use a cache_purge module:
I didn’t just want to purge, I wanted to update. If i just purged, then the next view to that URL would hit PHP-FPM/WordPress, and that view would be slower for that person. By doing proactive refreshing, I can effectively make sure no one ever gets a live WordPress view.
The only reason I can think of is you need to fully remove (or purge) a page is if you simply delete it (or rename it). Updating is far more common then removing. But wouldn't the expiry time you set in nginx config take care of that housecleaning anyway? (Say after 10m or so). The whole goal of nginx caching is to make sure you're never hitting the wp backend.
There's obviously pros and cons to all of this. On a lot of the sites I do, I can get away with a high expiry time since most of the content is static and you can cache more aggressively. If you have a ton of logged in users, nginx's micro cache is of a lesser benefit.
@RitterKnightCreative Many WordPress plugins add headers which bypasses cache.
You can see some references - https://www.google.com/search?q=fastcgi_ignore_headers+site%3Artcamp.com&oq=fastcgi_ignore_headers
We ignore fastcgi headers in order to get cache working many times.
I have read http://markjaquith.wordpress.com/2012/05/15/how-i-built-have-baby-need-stuff/ long time ago.
In Mark's example he is not "refreshing cached copy of content" in my opinion. As per his config, if anybody comment, they will not see cached-content. This is needed to show "your comment is awaiting moderation" and it shouldn't be cached. In fact, once you comment, cache should be bypassed for that visior based on cookie.
But, assume a site has no comment moderation. Then if user A posts comment on an article, if cache is supposed to "refresh", then user B (in different browser) should see that new comment on that article instantly. I don't think is is being achieved.
Besides, Mark is dealing with comments only I guess. What about if you make edit to post-content? What if you change title of sticky post and wish homepage to show updated post-title.
As far as I understand Nginx fastcgi-cache has only 2 mechanisms:
- Bypass cached content (
fastcgi_cache_bypass) i.e. content is in cache but don't show cached version. - Do not cache content (
fastcgi_no_cache) i.e. don't cache at all (e.g. wp-admin side)
There is nothing to tell nginx to delete something from cache or update something that is already in cache. Purge module takes care of delete part upto some extent.
Also, if you can wait till cached version expires, there is no need to use purge module then. Problem is multi-user gets confused. e.g. author published a post, send link to homepage. Other guy don't see new post on homepage. Different users/sites have different use cases. That is why we are digging deeper on cacheing front.
We are planning to test and include another nginx module - https://github.com/wandenberg/nginx-selective-cache-purge-module/ to improve purging but it will take time.
Personally, on rtcamp.com we don't purge cache for small content edits. Whenever we make major changes we simply flush entire cache from web-broswer by opening URL: https://example.com:22222/cache/nginx/clean.php (it's present on all easyengine servers since version 1.3)
I am not sure if this answers your questions and concerns. But please feel free to let me know if I missed anything.
@rahul286 Thanks for your update to EasyEngine 1.3.4. It seems to me as if the Pagespeed module isn't included. Any ETA for this one?
@lisadebrij pagespeed will take a lot more time. May be 2-3 months.
Going by our convention, it should be used on our own server first for atleast a week. If all goes well then we can include it stable easyengine version.
As of now, we haven't managed to get it working nicely on our server.
@rahul286 Thanks for your kind answer. What Pagespeed options did you use? Pagespeed as 'Configuring Downstream Cache' or only to strip and (minify css, js enz).
@lisadebrij I was trying to get minify working sometime ago. I ran into issue where HTML output contained minified as well as original scripts. I tried debugging for a day then.
As of now, I am looking for CSS + JS combining/minification mainly with pagespeed. Some image optimization will be added plus. I hope to start experimenting next month.
@rahul286 What about a pre-fetch of pre cache option to pre cache pages via Nginx's fastcgi_cache? It seems ideal to me, to keep. Important pages hot.
Closed? Why? It seems to be not fixed as pagespeed isn't included in your Nginx package.
@lisadebrij this thread already has a sub-task for pagespeed:
See: "Add nginx build with pagespeed module" above