Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I’m using a specific template on my self-hosted WordPress blog to display a page with randomized posts.

Recently, I configured W3 Total Cache to make use of a content delivery network (CDN). When not logged in as the administrator, a user will have some elements of the site served through the CDN instead of fetching a “live” version from the original server where it is hosted.

I noticed the randomization will not worked if the site is served through the CDN, but works perfectly well is served directly from the original server. More precisely, random posts will be displayed the first time the random post page is invoked. However, if the page is invoked again (or refresh from the browser) the very same posts will be displayed again. Whereas, when working normally, the page will displayed random posts each time it is accessed (or each time the page is refreshed from the browser).

W3 Total Cache has a specific field where the user can input content that must be exclude from the CDN. An example involving such an exclusion can be found here.

The question is simple: how can I exclude my random post template from being served through the CDN? Do I need to input the URL of the random post page or maybe the location of the template that does the randomization?

Thanks a lot,

P.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Got the solution. Instead of using the CDN exclusion list, I use the plugin (W3 Total Cache) “Page Cache” option.

Once logged in as the administrator, go to W3 Total Cache settings (a tab called “Performance”). Navigate to “Page Cache” and then to the field named “Never cache the following pages:” Finally enter the name of the page. For example, if the URL of your page is http://my_blog/random all you have to do is add the word random in the field.

It works even with a CDN set up.

P.

share|improve this answer
add comment

Take a look @ questions about fragment caching: http://wordpress.stackexchange.com/search?q=%22fragment%20caching%22

Especially: Can I ignore caching of a plugin in W3 Total Cache?

share|improve this answer
    
Hi, thanks for the suggestion. Since my random posts are displayed on a page, it’s the page I needed to exclude, which can be done easily with W3 Total Cache. I came to the solution by browsing through the thread you pointed to me. –  Parneix Apr 15 '12 at 13:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.