I've been using shared hosting up until recently before switching to a normal VPS for learning. Currently my server only run wordpress and forum on top nginx + mysql and nothing else. I've read somewhere that using Varnish will speed up my site loading time. For now, I don't need it but for learning sake I would like to ask a couple questions that I unable to google.
How does Varnish knows when will the file expired? Do I need to setup rules in the VCL or I can set the expiry header in Nginx/Apache and Varnish will handle it automatically?
Can I set different expiry time for different page? Example: 2 days for www.mydomain.com/page1.php and 5 days for www.mydomain.com/page2.php
Can I save forum search string for certain time (1 day)? Example: forum.mydomain.com/index.php?act=Search&search_in=posts&result_type=topics&highlite=mystring
Thank you in advance.