WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP CSS] how cache works ? (5 posts)

  1. ihk2010
    Member
    Posted 5 years ago #

    I just wanna know how cache works in wp-css

    I mean when cache files are created ? when every single user request the page

    I mean if I have 999 user..would I have 999 cache files,one for each user !?

  2. halmat
    Member
    Posted 5 years ago #

    Hi,

    The caching works on two levels.

    1) A CSS file is created inside the /cache/ folder.
    2) Once a user accesses your sites, expires and max age headers are sent to the user to cache the CSS file in their browser.

    Lets say you set the expiry time to 1,200,000 seconds which is about two weeks. The browser will use the cached file and won't bother checking if a new one exists.

    When these two weeks pass, the plugin will create a new file for CSS file and let the client's browser know via the 't' attribute (located at the end of the url for the css file) that it is a different file.

    So answer your question, only one CSS file is created.

  3. ihk2010
    Member
    Posted 5 years ago #

    @halmat:

    Thanks for your answer I get it now .

    I really love your plugins wp-css and wp-js and I use both.

    But what about all these files prefixed with tmp and only contain the word 'test'?
    I had a problem in my server concerning permissions,so I had to create /cache/ dir myself.

    is it related ? or it is just normal behavior of plugin ?

  4. halmat
    Member
    Posted 5 years ago #

    Glad to hear you're liking the plugins!

    The tmp files test to see if the wp-css directory is writable or not. I'll have a look through the code and found why doesn't delete those files. I'll also make sure it only runs in the admin page as not to effect performance.

    Creating the cache folder is normal behaviour (stated in the installation instructions). I can add a feature to automatically create the folder (some PHP server settings don't allow this though).

    Let me know if there are any other features you'd like to see. I'm open to any ideas :)

    Halmat

  5. mynetweblogs
    Member
    Posted 5 years ago #

    How does this plugin work with WP-SuperCache?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags