browser - static images aren't caching with php-generated page -


Our website was just changed to be generated by mod_rewrite and php scripts.

All picture formats follow:

  & lt; Img src = "/ images / header.png" /> ;  

I should avoid caching completely because the PHP parser needs to dynamically handle every page on each request; However, the download overhead of large images is cumbersome on each page load.

I will ideally provide the header for "cache-control: no-cache, sure-modify" and "expiry: some_date_in_the_past", to force PHP script to be re-verified.

Why is not the browser caching static images in all pages with consistent href values?

You can tell in your .htacess file that which file extensions you have fixed some headers For content you want to apply, you can provide header and dynamic content that ends in the future, you can write cache-not the modal cache has to be modified again.

  & lt; IfModule mod_deflate.c & gt; & Lt; File match ". (Js | css | html | php) $" & gt; SetOutputFilter DEFLATE & lt; / FilesMatch & gt; & Lt; / IfModule & gt; & Lt; IfModule mod_expires.c & gt; & Lt; File match ". (Gif | jpg | jpeg | png | swf | css | js | html? | Xml | txt] $" & gt; expiresDefault Access Type "Diffelt Plus 10 Years" Type Closing Image / X-icon A 604800 header set cache-control "Max-age = 290304000, public"   

Like this example I have a lot Only in the future all the different static file matches have finished the headers.

Note: File magnets tag and file extension .htacess file inside any of your applications Are placed in Holder and it gives these settings for that folder.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -