Mobile app version of vmapp.org
Login or Join
Kevin317

: Etags are not appearing on PHP pages My hosting provider (goDaddy) seems to be adding eTags to my files. However I've noticed that they are not appearing on .PHP file (they are on .HTM, .CSS,

@Kevin317

Posted in: #CacheControl #Htaccess

My hosting provider (goDaddy) seems to be adding eTags to my files.

However I've noticed that they are not appearing on .PHP file (they are on .HTM, .CSS, .JS and images). Is this normal?

From my reading up on etags there doesnt seem to be much you can do to configure them. Or is there something I can add to .htaccess to get etags on all files?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kevin317

1 Comments

Sorted by latest first Latest Oldest Best

 

@Rambettina238

This is normal for dynamic pages. An ETag is a unique identifier for that version of a particular file. The web server can automatically set ETags for static files (html, css etc.), because it can work out when their contents were last changed by looking at the file's last modified time (and some other attributes). There's no way for the web server to know when the HTML generated by your PHP scripts last changed because it is generated on the fly.

You can manually set an ETag from within the PHP script using PHP's header function, but you should only do that if you have a way to generate a unique identifier that will change when the content changes. Generally dynamic pages don't set ETags.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme