Leverage browser caching

Hi!
I placed an introduction image to access the site and i get an error: intro-image.jpg not specified

Do I specify this in the htaccess file?

any code I can copy paste there?

Thanks !

1 Like

I’m not sure what you mean by this. How/where did you place the image? You mentioned elsewhere that you’re using a CMS; is this a setting in your CMS, or something you are trying to do by yourself?

I also don’t understand how it relates to the title of your topic.

Please coulld you provide some more information.

Thanks TechnoBear,

the site is e-vape.deals and when you access it it opens an intro image (so you have to verify your age). i will use this image also for advertising purposes. Google checked out the site speed and gave me this…

well…and I try to fix that :blush:

If you’re already scoring 99/100, I really wouldn’t worry about a single image.

You can use something like this in your .htaccess to specify the expiry for different file types; adjust the time periods to suit your own requirements.

# Enable the mod_expires module
ExpiresActive On
# Set expiration date to 1 month for all style sheets and images
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
# Set expiration date to 1 week for all HTML pages
ExpiresByType text/html "access plus 1 week"
ExpiresByType application/xhtml+xml "access plus 1 week"
1 Like

For my site i also get the same message. I spoke to my webhost about it and he told me that it wouldn’t help in my case it the server was already doing some caching type thing. I don’t worry about it too much as my site is pretty fast.

I did try adding

`

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

`
to my .htaccess but it didn’t seem to do a lot.

2 Likes

I’m far from an expert in Apache, but my understanding is that using the <IfModule mod_expires.c> wrapper is both unnecessary, and an unnecessary use of server resources. If you’re unsure whether your server has the module, you use the IfModule once, to test. Once you’ve established that it exists on your server, you don’t need to run it every time.

1 Like

cool i’ll have a look a bit deeper into that and see if i need to change something. thanks

Hi!
I come up with a problem ! related to this… I cant find the .htaccess file.
The server uses nginx as a proxy which could be why I can not locate the .htaccess file, If this is the problem, how would the file be now what I am looking for? If I write a new .htaccess file and place it in the root, what will happen?

I don’t know a lot about nginx, but I found this:

1 Like

You can try W3 Total cache Plugin which is best cache plugin

Hey :slight_smile: what makes you think its a WP website? but thanks !! …and nope… its not WP

I think you’ll find some folk think every site is a WordPress site.

4 Likes

W3 Total cache can cause some issues if not used properly… best to follow plugin guidelines…
Just saying. :slight_smile:
http://www.onlinemediamasters.com/w3-total-cache-settings/

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.