whiteboikyle Posted May 7, 2009 Share Posted May 7, 2009 Okay well users on my site can upload there own image to the site and it uploaded to teh mysql. Now everytime you refresh the page it has to "reload" the image again. Is there a way to make it save it in your temp directory so it doesn't have to reload? Quote Link to comment Share on other sites More sharing options...
dreamwest Posted May 7, 2009 Share Posted May 7, 2009 # 1 WEEK <FilesMatch "\.(jpg|jpeg|gif|ico|png)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted May 7, 2009 Author Share Posted May 7, 2009 If i put that in my header it will be fine? Quote Link to comment Share on other sites More sharing options...
dreamwest Posted May 7, 2009 Share Posted May 7, 2009 No. chuck it in .htaccess You can also cache files as well # 5 MIN <FilesMatch "\.(css|js|swf|flv)$"> Header set Cache-Control "max-age=172800, private, proxy-revalidate" </FilesMatch> It will dramatically increase your speed Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted May 7, 2009 Author Share Posted May 7, 2009 okay so i made .htaccess and saved. Then uploaded it to my directory where my files are.. I still see the images reloading.. What did i do wrong? Quote Link to comment Share on other sites More sharing options...
dreamwest Posted May 7, 2009 Share Posted May 7, 2009 did you put .htaccess in root directory? http://site.com/.htaccess If you did - check your browser to allow caching from sites. Most browser have caching on by default Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted May 7, 2009 Author Share Posted May 7, 2009 http://clanan.net/.htaccess Says access denied.. but i checked my hosting and it says. .htaccess enabled. Quote Link to comment Share on other sites More sharing options...
dreamwest Posted May 7, 2009 Share Posted May 7, 2009 http://clanan.net/.htaccess Says access denied.. but i checked my hosting and it says. .htaccess enabled. You cant access htaccess files with your browser. If you refreash you browser the images will reload again. Trying surfing you site a bit the images should appear instantly Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted May 8, 2009 Author Share Posted May 8, 2009 Nope its still reloading the same image.. Do i have to include .htaccess or something? Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted May 8, 2009 Author Share Posted May 8, 2009 Anyone else know any other ways to do so? Quote Link to comment Share on other sites More sharing options...
dreamwest Posted May 8, 2009 Share Posted May 8, 2009 Dont include htaccess files, im not sure if you can anyway. If you put htacces in your root directory of your site: http://site.com/.htaccess and have htaccess enabled then something else is going on I definately works ive been using it for 2 years Make sure the htaccess file has no extensions as well Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 So hard to get people to follow direct instructions nowadays. *Ken2k7 sighs Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted May 8, 2009 Author Share Posted May 8, 2009 all i put is # 5 MIN <FilesMatch "\.(css|js|swf|flv)$"> Header set Cache-Control "max-age=172800, private, proxy-revalidate" </FilesMatch> # 1 WEEK <FilesMatch "\.(jpg|jpeg|gif|ico|png)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> uploaded it to my root directory (of the main site) .htaccess enabled.. doesn't work.. Dono why.. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 Well there's no way it's not going to reload if you reload the page. :-\ Quote Link to comment Share on other sites More sharing options...
dreamwest Posted May 8, 2009 Share Posted May 8, 2009 uploaded it to my root directory (of the main site) .htaccess enabled.. doesn't work.. Dono why.. Dont refreash your browser it will clear the cache and reload everything again. Just surf your site normally through hyperlinks Example: http://site.com/image_page.html > http://site.com/no_image_page.html > http://site.com/image_page.html When revisiting the 1st url all your images will load instantly Quote Link to comment Share on other sites More sharing options...
whiteboikyle Posted May 8, 2009 Author Share Posted May 8, 2009 http://clanan.net/index.php Try it, it dont work for me.. Quote Link to comment Share on other sites More sharing options...
dreamwest Posted May 8, 2009 Share Posted May 8, 2009 Yes works perfectly. Images are cached and instantly load. It must be your browser Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.