Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
nginx config suggestion for redis page cache (and the future) #754
When you create a site with ee using the redis page cache, the files
That causes the problem on a host that handles many different domains that when you use the nginx-helper's "purge cache" option, you not only purge the page cache for the site you are working with, you purge the entire page cache for every site that uses the default
If you want to change the prefix in the plugin settings on a domain by domain basis so that you can purge the page cache for one domain at a time, you also have to make the corresponding edit in the
I suggest making the following changes in ee:
Then you can change the
It would also be good to put some documentation in the nginx-helper plugin about the necessary nginx configuration to make use of the
Tangentially, I have been thinking a lot about how to make it possible to customize various nginx configurations while staying compatible with ee updates and it seems to me that the approach detailed above, where you define a macro in the vhost configuration file under
What I have been doing in the mean time is creating my own
Would be a lot nicer if nginx let us do conditional includes so that we could instead override the
Implementing this idea even in the specific use-case I outlined above would be a significant project. Including maintaining backward compatibility for those with existing ee installs makes it critical to get it right. So I think this has to be a job for core ee developers who know the future roadmap well to take on. I'm just suggesting one possible approach for the future.
Any thoughts on this idea, @rahul286 ?
i'll reiterate this suggestion and say that i have been using it in production since the OP above almost two years ago and it works fine. I can host multiple sites on a given server, give each one their own page cache
@rahul286 that sounds like an interesting plan. I wonder from a resource usage point of view what it will cost (memory-wise, mostly) to have multiple redis containers running simultaneously vs. a single redis instance that is used by all sites hosted on a server.
if the overhead of running a redis container per site is not too burdensome, then it would definitely make my hack unnecessary and simplify things a lot, so great.