How to avoid apache restart for gettext cache issue

Many applications use gettext for i18n and l10n. Gettext is PHP extension which holds translation strings in key-value pair. The translation is cached when apache first open the file which is good. However the issue with the cache raises a problem when you change some string and want to view the changes. In development environment it is easy solvable – just restart apache, but the problem in production environment can be bigger, especially when you have no rights to restart the web server.

The issue can be solved in PHP, but if it is one time change the effort does not deserve doing it. An easier way is to delete the .po file, refresh the page, upload the changes and refresh again. A much quicker way. Enjoy :)

 

Tagged with: , , ,
Posted in Apache, PHP
2 comments on “How to avoid apache restart for gettext cache issue
  1. edwardh says:

    At least trying it out with xampp, this method doesn’t work. It keeps the cache even after deleting the .po file and refreshing the page.

  2. kode says:

    That sounds strange. You could try the link and try the steps there. It takes more time , but is more durable solution.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Sites
Categories
Archives