×ðÁú¿­Ê±¹ÙÍøµÇ¼

nginx304¹ýʧÔõô½â¾ö

ÎÊÌâµÄÃÕµ×£º304 not modified ¹ýʧÌåÏÖä¯ÀÀÆ÷ÒÑ»º´æ¿Í»§¶ËÇëÇóµÄ×îÐÂ×ÊÔ´°æ±¾¡£½â¾ö¼Æ»®£º1. ɨ³ýä¯ÀÀÆ÷»º´æ £»2. ½ûÓÃä¯ÀÀÆ÷»º´æ £»3. ÉèÖà nginx ÔÊÐí¿Í»§¶Ë»º´æ £»4. ¼ì²éÎļþȨÏÞ £»5. ¼ì²éÎļþ¹þÏ£ £»6. ½ûÓà cdn »ò·´ÏòÊðÀí»º´æ £»7. ÖØÆô nginx¡£

ÔõÑù½â¾ö Nginx 304 ¹ýʧ

ÎÊÌ⣺Ϊʲô»á·ºÆð Nginx 304 ¹ýʧ £¿

»Ø¸²£º304 Not Modified ¹ýʧÌåÏÖä¯ÀÀÆ÷»º´æÖÐÒѱ£´æ¿Í»§¶ËÇëÇóµÄ×ÊÔ´µÄ×îа汾£¬Òò´ËÎÞÐèÔÙ´ÎÏÂÔظÃ×ÊÔ´¡£

½â¾ö¼Æ»®£º

1. ɨ³ýä¯ÀÀÆ÷»º´æ

ÔÚ Chrome ÉÏ£ºCtrl + Shift + Del

ÔÚ Firefox ÉÏ£ºCtrl + Shift + Delete

ÔÚ Safari ÉÏ£ºCmd + Option + E

ÔÚ Edge ÉÏ£ºCtrl + Shift + Del

2. ½ûÓÃä¯ÀÀÆ÷»º´æ

¹ØÓÚ¿ª·¢ºÍµ÷ÊÔÄ¿µÄ£¬¿ÉÒÔÔÝʱ½ûÓÃä¯ÀÀÆ÷»º´æ£º

ÔÚ Chrome ÉÏ£º°´ F12 ·­¿ª¿ª·¢Õß¹¤¾ß£¬È»ºóתµ½ÍøÂçÑ¡Ï²¢Ñ¡ÖС°½ûÓûº´æ¡±¡£

ÔÚ Firefox ÉÏ£ºÔڵصãÀ¸ÖмüÈë¡°about:config¡±£¬ËÑË÷¡°network.http.use-cache¡±£¬²¢½«ÆäÉèÖÃΪ¡°false¡±¡£

3. ÉèÖà Nginx ÔÊÐí¿Í»§¶Ë»º´æ

È·±£ Nginx ÉèÖÃÖÐÔÊÐí¿Í»§¶Ë»º´æ£º

location / {
    expires 1d;
    add_header Cache-Control "public";
}

µÇ¼ºó¸´ÖÆ

4. ¼ì²éÎļþȨÏÞ

È·±£ Web ЧÀÍÓþßÓжÁÈ¡ÎļþËùÐèµÄȨÏÞ£º

Linux£ºÊ¹Óà chown »ò chmod ÏÂÁîÐÞ¸ÄÎļþ»òĿ¼µÄȨÏÞ¡£

Windows£ºÓÒ¼üµ¥»÷Îļþ»òÎļþ¼Ð£¬Ñ¡Ôñ¡°ÊôÐÔ¡±£¬È»ºóÐ޸ġ°Çå¾²¡±Ñ¡ÏÖеÄȨÏÞ¡£

5. ¼ì²éÎļþ¹þÏ£

304 ¹ýʧҲ¿ÉÄÜÊÇÓÉÓÚÎļþ¹þÏ£²»Æ¥ÅäÔì³ÉµÄ¡£Ê¹Óà md5sum »ò sha256sum ÏÂÁî¼ì²éÎļþ¹þÏ£ÊÇ·ñÆ¥ÅäЧÀÍÆ÷ÉϵĹþÏ£¡£

6. ½ûÓà CDN »ò·´ÏòÊðÀí»º´æ

ÈôÊÇʹÓà CDN »ò·´ÏòÊðÀí£¬Çë¼ì²éÆäÉèÖÃÊÇ·ñ½ûÓûº´æ¡£

7. ÖØÆô Nginx

ÔÚ¾ÙÐиü¸Äºó£¬ÇëÖØÆô Nginx ÒÔʹ¸ü¸ÄÉúЧ¡£

ÒÔÉϾÍÊÇnginx304¹ýʧÔõô½â¾öµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ