Support » Fixing WordPress » htaccess code to leverage browser caching. Use the word “plus”?

  • Resolved Ronnie55

    (@ronnie55)


    Hi,

    I’m researching how to add code to my htaccess file, to leverage browser caching.

    Half the websites offering code snippets seem to provide lines of code like this:

    ExpiresByType image/jpg "access 1 year"

    But the other half seem to add the word “plus” to each line. Like this:

    ExpiresByType image/jpg "access plus 1 year"

    I’ve asked around and haven’t been able to figure out what the word “plus” does. Does anyone know?

    Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    For example ExpiresByType image/jpg "access plus 1 year" means:

    make documents expire 1 year after being accessed.

    Moderator t-p

    (@t-p)

    ExpiresByType image/jpg "access 1 year"
    That code states that a .jpg file (image) should be cached for a year.

    Thanks for the reply. Really appreciate it.

    I had assumed that’s how this functions in general… if someone visits on May 10, and I set the file type to last 1 year in their browser cache, it’ll stay until May 10 the next year?

    I guess now I don’t understand what ExpiresByType image/jpg "access 1 year" does. (without the word “plus”).

    edit: okay, I see your 2nd reply now. Thanks. Hmm, okay, I guess I’ll have to think about which is best. I’m thinking it should be a year (or a month, or whatever) from when someone first accesses it. That’s how I assumed this all works anyway.

    Then if they come back a year later, they’d re-load everything. That seems good.

    • This reply was modified 1 year, 1 month ago by Ronnie55.
    Moderator t-p

    (@t-p)

    You are welcome 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘htaccess code to leverage browser caching. Use the word “plus”?’ is closed to new replies.