WordPress.org

Ready to get started?Download WordPress

Forums

IIS and Output Caching (2 posts)

  1. husdaman
    Member
    Posted 4 months ago #

    Hi there,

    I'm trying to setup Output Caching in IIS 7.5 for all php files in WordPress. I was able to make it work but noticed that my admin bar got cached If I was logged in. This would result in all users seeing my version of the first page. I also noticed that when someone searched and the cache expired at the that moment, it would fetch results of the search query and display it as my homepage until the cache expired. I don't know how to fix this and I feel that I'm very close to get this working.

    We are a school board who get a lot of concurrent users (500 - 1500) when we have bad weather. The server is unable to serve all these people at once.

    My web.config file had this below which I have since removed because of the problems above.

    <add extension=".php" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="00:00:30" varyByHeaders="x-original-url" />

    Does anyone know how to set this up to make it work properly?

    Thank you in advance.

  2. husdaman
    Member
    Posted 4 months ago #

    I think I figured it out. The above line should be
    <add extension=".php" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="00:00:30" varyByHeaders="x-original-url" varyByQueryString="*" /> in web.config.

    varyByQueryString="*" was added to the line.

    I haven't figured out the problem with caching my admin bar yet. I just decided to remove the admin bar for now by putting this in my functions.php file.

    /* Disable WordPress Admin Bar for all users but admins. */
    show_admin_bar(false);

    If anyone has an idea about the admin bar caching please let me know.

Reply

You must log in to post.

About this Topic