exclude from varnish cache the xenforo control panel - varnish-vcl

i'd like varnish make cache for all pages domain exmaple.com except caching the control panel for this domain i exclude only control panel like
https://example.com/admin.php?xxxxxx
i see some solution like here varnish exclude url but i did not succed
exclude admin.php and any things after it i use varnish 5 thanks

Related

How to change the purge url on save

I have a plone website on which I want to set up a Varnish cache. The caching part is working great, but I have problems on the purging part.
On my setup, the "view" URL and the "edit" URL are on two different names (eg. myexample.com and plone.example.com/MyExample/) and this Plone is on a multisite environment.
Up to this point, when I save a page on the "edit server", it sends a purge request, but on the "edit" URL. (eg. on /MyExample/my/path instead of /my/path).
Question is : what's the easiest / best way to rewrite the purge URL to remove the leading /MyExample part ?
I am new to Plone and to Varnish, so any help is appreciated.
Since some purge urls are being generated, I assume that you are already using the caching tools shipped with Plone.
It could be that altering those purge paths in required way, would require to write an additional purge add-on for Plone caching tool.
Instead you may want to try an add-on called collective.purgebyid (requires some additional Varnish config). It adds an additional purge strategy based on involved unique content ids instead of paths.

Is CMS caching needed while it runs on Varnish Cache?

I know that the question seems weird but i am really not sure about it.
I am running a bunch of Joomla, Wordpress and Magento websites and i am not sure if there is a need to enable build-in CMS cache while they run on varnish.
Yes , Of course that is needed
varnish and other caching tools just cache the static part of your website
but Joomla cache system is more powerful and doing the backed cache part of your website , for example some components force Joomla to dont cache their content as they are depending on users action or user status or ...
so Joomla will cache the pages that are same for all users and will show to them this pages from cache without many database query and ACL check and ...

How to leverage browser cache and serve from a cookieless domain with a subdomain? (with cdn)

I am using W3 Total Cache on Wordpress with Amazon Cloudfront as my CDN. But when I run my site through the Pingdom Website Speed Test, it still says I need to 'Leverage browser caching' and 'Serve static content from a cookieless domain'. I noticed that the links affected are my cdn.domain.com links so I'm wondering if it's possible to leverage browser cache on my subdomain and set it to be cookieless?
1) The problem is that Wordpress doesn't send cache info at user uploaded files, also W3 Total Cache doesn't fix this.
Here some example how to fix this: http://www.askapache.com/hacking/speed-site-caching-cache-control.html
2) To avoid that the browser send cookies to your cdn subdomain you have to be sure that site is launched at www.yourdomain.com and not yourdomain.com. Redirect the visitor to www.yourdomain.com when the visitor entered only the domain name. You can edit the .htaccess file in the root of your site, see:
http://dense13.com/blog/2008/02/27/redirecting-non-www-to-www-with-htaccess/

Can I use codeigniter session cookie data for authentication?

I have a CodeIgniter install, which I use for most of the site. I have a /blog folder, in which I have a Wordpress install.
Goal: pages inside the /blog will look have the same header as the rest of the site. They'll also have all the features of Wordpress.
For pages inside the /blog folder (running Wordpress), I'm loading the CodeIgniter header view via a file_get_contents() call, since I don't have access to the CI framework from within Wordpress. I prefer not to create another copy of the header view within the Wordpress template, because I'd like to maintain just one file.
Now here's the problem: I can't maintain the user's state in Wordpress, because I don't have access to CodeIgniter's session.
Since the call to the header is done via file_get_contents(), the server doesn't have access to the same session as the client (since it is in effect a call from the server).
Is there a way I can transfer the session cookie data into CodeIgniter via the URL? Something like:
file_get_contents('http://mydomain.com/header.php?data=SESSIONDATA').
Am I even thinking about this the right way? Note that we are obviously on the same domain, just a different folder.
Check out the following links that might be useful:
http://wordpress.org/extend/plugins/wp-code-igniter/
http://jidd.jimisaacs.com/post/wordigniter-wordpress-codeigniter/

Having separate themes - if the same host address has www. and a version with no www.

I have a set of themes for my website, which are to be used with different requests from different urls. So if the url = www.xyz.com I load a different theme, as opposed to www.abc.com.
However, I have tried having a theme called www.abc.com and a theme called abc.com, and in my webform codebehind I have a preinit page event which says if url.contains(abc.com), then load theme abc.com, if url.contains(www.abc.com), then load theme www.abc.com (valid theme).
Starting from the beginning again, what is the best way to have and call a theme depending on whether the url has www. or not, but the same host. So how can I have separate themes for abc.com and www.abc.com, and then load the latter when the url is www.abc.com and the former when the url, is obviously, abc.com?
Not exactly sure what you're after here, but if you are testing the url in that order, and using an else, then it looks like the first case will always be true, so test for the more specific case (www) first.
Would also suggest that you look at testing for url.StartsWith, and include the protocol variations that you might expect, as you never know if those strings might show up somewhere else in the url in a year or two, and your theme switcher might stop working.
You could then just swap around master pages to change your theme, or if you are using the App_Theme thing, do some switching on that. Always found the aspnet theme thing to be a little bit clunky myself.

Resources