Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

TarikAli's avatar

cash-control in .htaccess not working

i use laravel 5.5 i uploaded my site to a shared hosting , i want to cash static files like .css and js ...... . so i put this code in my .htaccess

<FilesMatch ".(ico|flv|jpe?g|png|gif|js|css|swf|ttf|otf|woff|eot)$"> Header set Cache-Control "max-age=290304000, public"

but in chrome / network tab i select my page the Response header : Cache-Control:no-cache, private Request header : Cache-Control:no-cache Pragma:no-cache

whats the wrong with my cod

thanks

0 likes
2 replies
TarikAli's avatar

ok i forgot that the hosting is windows so i wrote another code in web.config and it works. thanks

Please or to participate in this conversation.