Hot answers tagged

15

Ok, Carlo, I'll get in this improved answer tonight, anyway, probably cut down and informate the other answer in morning here, so comments stay. I've got a sick animal here house-sitting for brother & family, why I'm a little slow. To accelerate what you have, it really depends on the content - whether you have logins or other personalization among your ...


10

I'm by no means a Varnish pro, but I'm currently working on a project where we're running Varnish 4.0 in front of our nginx servers. I've uploaded an example of our VCL 4.0 file in this gist. It is based on the Varnish 4.0 template made by Mattias Geniar with some adjustments for Craft. It is NOT an exact port of the 3.x file you're referencing, so it's ...


4

As requested, here's a Varnish (3.x) configuration we use: https://gist.github.com/timkelty/35625a90a6819c8f7927 This is one setup for ExpressionEngine, but the only thing there really specific to that is the EE_PURGE request portion, which makes it work with: https://github.com/kevincupp/purge.ee2_addon We have it set up so site.com:8080 is the un-...


4

[Edit: I'm deprecating this answer, having a better one up now I believe, but leaving it as it's attracted very useful comments. I think what's said here isn't quite wrong, but has been considerably improved upon, and can be more so as the community gains experience. In particular, though for good reason, Railgun has turned out to be more naive than I ...


3

Not sure how you can do this, but you could manually print the response to a file yourself on a regular basis (as a cron job) using wget: This: wget -S http://craft.fira/fullmembers.json …saves the JSON into a file named fullmembers.json into the directory it was run from. Here is the solution that I have used in a cron job that runs every minute: wget -...


3

You could use my Preparse Field plugin to generate transforms when an entry (or any other element) is saved. Create a preparse field and create some twig that makes the same transforms that you do in your template. Don't care about the output, the only thing you want it to do is generate the images on save. Assuming you attach the field to an entry, and ...


2

The best advice I could find on this is in another SE page: Any way to manually generate a transform on an asset source? Seems to boil down to two things: Brad suggests rightly that trying to do this all at once can be a heavy job, and so to ask Craft to do so may be asking for trouble, e.g. timeouts on PHP, cutouts on web hoster runaway safeties, etc.. ...


1

So the answer is to test the cookie for a name with username in it, and pass if it exists. You could also check for an exactly 32 digit alphanumeric cookie name I guess. if ( req.http.Cookie ~ "username" # Craft sessions have the word username in them ) { return (pass); }`


Only top voted, non community-wiki answers of a minimum length are eligible