본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Cache control through htaccess

more options

Tried this on a live site with a large image of name like something-welding-something.png

<IfModule mod_headers.c>

   <FilesMatch "welding">
       Header set Cache-Control "max-age=30, public"
   </FilesMatch>

</IfModule>

How do I prove it works? What am I doing wrong?

In Firefox enter yourdomainurl into the url box. Display webpage.

Open Firefox dev window go to network tab and filter by welding

On webpage hit <Ctrl-F5> network traffic shows image fetched from server.

Open another browser tab and look at about:cache?storage=disk Find the image and the expiry time is 30s past last modified time.

On webpage hit <Ctrl-R> network traffic shows cached. On webpage hit <Ctrl-R> nothing appears in network traffic!! On webpage hit <Ctrl-R> nothing appears in network traffic!! Wait, hit <Ctrl-R> again still But on the about:cache page the Last Modified time is now after the Expires time!

Enter some other domain (e.g. bbc.co.uk) into the url box instead of yourdomainurl.

Wait 30 seconds and then re-enter yourdomainurl (do not use back button). Network traffic for image shows cached. The expiry time now shows No expiration time.

Tried this on a live site with a large image of name like something-welding-something.png <IfModule mod_headers.c> <FilesMatch "welding"> Header set Cache-Control "max-age=30, public" </FilesMatch> </IfModule> How do I prove it works? What am I doing wrong? In Firefox enter ''yourdomainurl'' into the url box. Display webpage. Open Firefox dev window go to network tab and filter by ''welding'' On webpage hit <Ctrl-F5> network traffic shows image fetched from server. Open another browser tab and look at about:cache?storage=disk Find the image and the expiry time is 30s past last modified time. On webpage hit <Ctrl-R> network traffic shows cached. On webpage hit <Ctrl-R> '''nothing appears in network traffic!!''' On webpage hit <Ctrl-R> '''nothing appears in network traffic!!''' Wait, hit <Ctrl-R> again still '''But on the about:cache page the Last Modified time is now after the Expires time!''' Enter some other domain (e.g. bbc.co.uk) into the url box instead of yourdomainurl. Wait 30 seconds and then re-enter yourdomainurl (do not use back button). Network traffic for image shows cached. '''The expiry time now shows No expiration time.'''

모든 댓글 (1)

more options

If a cached resource has expired, it is strange that reloading doesn't at least ping the server to see whether the resource has been updated.

I don't know whether that is intentional or accidental.

Maybe someone else knows why that would be.

Alternately, if this causes a problem, you could submit a bug report on https://bugzilla.mozilla.org/